Unregister the listener in onStop() instead of onDestroy()
Bug: 3259661
This commit is contained in:
@@ -96,10 +96,15 @@ public class ManageAccountsSettings extends AccountPreferenceBase
|
||||
super.onCreate(icicle);
|
||||
|
||||
addPreferencesFromResource(R.xml.manage_accounts_settings);
|
||||
AccountManager.get(getActivity()).addOnAccountsUpdatedListener(this, null, true);
|
||||
setHasOptionsMenu(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
AccountManager.get(getActivity()).addOnAccountsUpdatedListener(this, null, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
@@ -130,9 +135,9 @@ public class ManageAccountsSettings extends AccountPreferenceBase
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
AccountManager.get(getActivity()).removeOnAccountsUpdatedListener(this);
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user