The activity is not being "recreated", it is only being "restarted". This is a normal part of the activity lifecycle. If the activity was being recreated due to a config change, you would also see onDestroy()
and onCreate()
being called again. This is clearly not the case.
There is no configuration change going on here, which is why onConfigurationChanged()
is not being called.
I think what is happening has to do with the fact that the screen is off/locked when your activity is launched. The activity is created and resumed, but then Android notices that the screen is off/locked, so it pauses the activity. Then it realizes that the activity should be shown, so it resumes the activity. I'm not able to test this case exactly right now, but I'm sure that I've seen similar behaviour in my own apps when we launch an activity while the screen is off.
Your app should be able to deal with multiple calls to onStart()
, onStop()
, onRestart()
, onPause()
and onResume()
without getting confused. If not, you'll need to fix that.