Comment 1 for bug 1317845

Revision history for this message
Donatas Baliuka (donatas-baliuka-0) wrote :

I analyzed crashes of type 3 and noticed that some classes derived from BaseFragment(eg. AboutFragment)
have code:
public void onDestroy() {
  super.onDestroy();
  scope.main().getActionBar().setDisplayHomeAsUpEnabled(true);
  scope.main().getActionBar().setHomeButtonEnabled(true);
 }
and some have code:
public void onStop() {
 {
  super.onStop();
  scope.main().getActionBar().setDisplayHomeAsUpEnabled(true);
  scope.main().getActionBar().setHomeButtonEnabled(true);
 }

Crashes sometimes happen in the classes with onDestroy() method( null pointer exception).
I have a question: When a class must have code in the method onDestroy() and when in the method onStop()?