Note Fragment:

It is very similar to Activity. It is used to describe some behaviors or a part of the user interface in an Activity. Multiple Fragments can be used to create multiple UI panels in a single Activity. You can also reuse Fragments in multiple Activities.
A Fragment must be Embedded in an Activity, its life cycle is directly affected by the life cycle of the host Activity to which it belongs.
When the Activity is suspended, all Fragments in it are also suspended. When the Activity is destroyed, all Fragments belonging to it will also be Is destroyed, when an Activity is running (in the resumed state), we can operate on each Fragment individually

Guess you like

Origin blog.csdn.net/qq_42823109/article/details/94361692