OnPause null reference exception correction

This commit is contained in:
Bonneville
2017-02-03 10:02:41 -05:00
parent ebf3f9446c
commit cdf8d5c973

View File

@@ -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();