Commit 4dbacd79 authored by tonymanou's avatar tonymanou Committed by topjohnwu

Matching event [un]registering, call super at the end of onPause/onDestroy

Event unregistered in onDestroy() should be registered in onCreate() to
avoid being registered multiple times.
parent ae74d544
......@@ -92,13 +92,13 @@ public class MainActivity extends AppCompatActivity
}
navigationView.setNavigationItemSelectedListener(this);
CallbackHandler.register(recreate, this);
}
@Override
protected void onResume() {
super.onResume();
CallbackHandler.register(StatusFragment.updateCheckDone, this);
CallbackHandler.register(recreate, this);
if (StatusFragment.updateCheckDone.isTriggered) {
onTrigger(StatusFragment.updateCheckDone);
}
......@@ -107,14 +107,14 @@ public class MainActivity extends AppCompatActivity
@Override
protected void onPause() {
super.onPause();
CallbackHandler.unRegister(StatusFragment.updateCheckDone, this);
super.onPause();
}
@Override
protected void onDestroy() {
super.onDestroy();
CallbackHandler.unRegister(recreate, this);
super.onDestroy();
}
@Override
......
......@@ -131,8 +131,8 @@ public class SettingsActivity extends AppCompatActivity {
@Override
public void onDestroy() {
super.onDestroy();
prefs.unregisterOnSharedPreferenceChangeListener(this);
super.onDestroy();
}
@Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment