Couldn\'t find a solid answer to this anywhere. I have a method where finish() is being called, and onPause() is called afterward.
Is onPause() guaranteed to be cal
It is a bit late but may help future visitors.
I faced the problem of onPause()
not being called when I tried to make an splash screen for my app following this tutorial.
After some fiddling around and forcing my mind I figured out why! the onCreate()
method looks like this:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = new Intent(this, MainActivity.class);
startActivity(intent);
finish();
}
So before the activity gets a chance to get started or resumed I was forcing it to be finished and so bypassing the other state method calls!
But as far as I know from the official Activity documentation in any other situation (at least normal ones!) the onPause()
method is guaranteed to be called!