The life cycle of the fragment is done in the following order: Onattach (), OnCreate (), Oncreateview (), onactivitycreated (), OnStart (), Onresume (), OnPause (), OnStop (), Ondestoryview (), Ondestory (), Ondetach ().
The life cycle of the fragment is dependent on the activity's life cycle, and the life cycle of the fragment can run independently only when the activity is in the resumed state.
Onattach (): Binds the activity to get the value that the activity passes over
Oncreateview (): Create a view for fragment or load a layout, update the layout
Onactivitycreated (): Called when the OnCreate () method in activity is called
Ondestoryview (): Remove the Fragment layout
Ondetach (): Unbind with activity
When creating the Fragment Experience Onattach (), OnCreate (), Oncreateview (), onactivitycreated ()
Fragment is visible to the user through OnStart (), Onresume ()
Fragment Experience OnPause (), OnStop () when not visible to users
Fragment Destruction Experience OnPause (), OnStop (), Ondestoryview (), Ondestory (), Ondetach ()
Remove a ListView border
Android:divider= "#ffffff"
Fragment life cycle