When you press home and re-return to the application, the activation is recreated, but when you rotate the device, it is also recreated. How to distinguish these two events programmatically?
1 answer

@Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); setContentView(R.layout.myLayout); } when turning
@Override protected void onResume() { super.onResume(); } when returning, or onPause, or onCreate and check the bundle for null
- that's right, he did, but the strange thing is: if you press the back program to close, start it - onCreate is called. Then press home, the program also disappears from the screen, we launch it - but now onCreate is not called. I need to somehow track every occurrence of activations on the screen (but NOT the turn!). - alex-v
- added materiel - Gorets
- everything is just like that. To track the appearance of the activation after pressing home, you need to use onStart (if I understood correctly?). But how then in onStart to distinguish the moment from the turn (there is no Bundle savedInstanceState)? - alex-v
|