mirror of
https://github.com/wismna/DoNext.git
synced 2025-10-03 07:30:13 -04:00
OnPause null reference exception correction
This commit is contained in:
@@ -106,7 +106,10 @@ public class MainActivity extends AppCompatActivity implements TasksFragment.Tas
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
// Save currently opened tab
|
||||
|
||||
// No tabs exist yet, nothing to save
|
||||
if (mViewPager == null) return;
|
||||
// Otherwise, save currently opened tab
|
||||
SharedPreferences sharedPref =
|
||||
PreferenceManager.getDefaultSharedPreferences(MainActivity.this);
|
||||
SharedPreferences.Editor editor = sharedPref.edit();
|
||||
|
Reference in New Issue
Block a user