1. I just found an amazing thing. In tabactivity, gettabhost () is used (). setcurrenttab (2); set the current subactivity to the first, for example, the second, but the first subactivity will still create. Currently, we do not know the situation after create and whether it is related to setdefatab tab.
2 In activitygroup
@ Override
Public void onbackpressed (){
// Todo auto-generated method stub
Super. onbackpressed ();
}
Will not be called.
3 activity has two functions that can be reloaded. It looks interesting.
Void |
Onpostcreate (bundle savedinstancestate) Called when Activity start-up is complete (afteronStart() AndonRestoreInstanceState(Bundle) Have been called ). |
Void |
Onpostresume () Called when activity resume is complete (afteronResume() Has been called ). |
You have to consider the usage.
4. the lifecycle of an activity is stack-based. For details on this document, create-> Start-> resum-> pause-> stop-> destroy. When power saving is locked, the activity enters the pause state, the active push to the background enters the Stop State (the home key, do not know whether the return key is), and CALLS finish directly to enter destroy. if the background is forcibly reclaimed, destroy is not called, if a program breaks into the foreground, is the current program like pause or stop?
Interestingly, activitygroup is associated with the subactivity lifecycle. For example, activitygroup group and subactivity Sub:
Groupcreate-> subcreate-> substart-> groupstart-> subresume-> groupresume-> subpause-> grouppause-> substop-> groupstop-> subdestroy-> groupdestroy
Switch from suba1 to the new suba2, suba1pause-> suba2create...
The switching between them is the form of pause and resume first.
After both suba1 and suba2 are started, stop at suba1, and finish:
[SubA1-pause]-> [Group-Pause]-> [subA1-stop]-> [subA2-stop]-> [Group-Stop]-> [subA1-Destroy]-> [subA2-Destroy]-> [group-destroy]
If you stay at suba2, yes
[SubA2-pause]-> [Group-Pause]->...
That's it.