This bothers me, because when I open the application and press the button on the house, onPause () is called, and the action reaches the “paused” state with its activity hidden in the OS, as shown in the figure.
I would not say that it is "hidden". Your activity is alive and healthy, just stopped.
It should still be running in the background because onDestroy () is not when I click the home button.
It is right. When you press the home button, you say to the operating system, "Hey, I’m going to another place, but I don’t necessarily do it."
If you click the back button instead, you will see onDestroy . Here you say to the operating system, "Well, I’ve finished this activity, doing what you want with it."
What exactly do they mean by "the object of activity does not exist?" when is it clearly paused in the background?
The hidden state is entered when the OS needs to destroy your activity without "telling" it about it (for example, by clicking the "Back" button). This happens when your device goes through a device configuration change. A classic example is rotation. This also happens if the OS needs to free up memory. In this case, onSaveInstanceState will be called to capture the state of your activity in the Bundle . The hidden state is the preservation of this Bundle and the class name of your activity. The actual Activity object is marked for garbage collection. Then, given only the Bundle object and the class name of your activity, the OS can create a new instance of your activity if the user returns to it.
One of them is that you do not need to execute onSaveInstanceState yourself if there is no specific information that you want to keep. Some components of the view hierarchy will automatically add information about themselves in the Bundle, because the super Activity.onSaveInstanceState will still be called. From the docs:
The default implementation provides most of the user interface for each instance for you by calling onSaveInstanceState () for each view in the hierarchy with an identifier and saving the current identifier (all of which are restored to the default ofRestoreInstanceState (Bundle)). If you override this method to save additional information that does not fall into each individual view, you will most likely want to turn to the default implementation, otherwise be prepared to save all the state of each view yourself.
http://developer.android.com/reference/android/app/Activity.html#onSaveInstanceState(android.os.Bundle)
You can check the source here: https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/core/java/android/app/Activity.java#1371