1, Standard boot mode
Through the task stack, each point button, each instance is pressed in, and then point back to the key when it pops up before the instance pressed in.
Test code: Displays the ID of the Tastid and instance itself by creating a button and TextView
1 Public classMainactivityextendsappcompatactivity {2 3 PrivateTextView TV;4 @Override5 protected voidonCreate (Bundle savedinstancestate) {6 Super. OnCreate (savedinstancestate);7 Setcontentview (r.layout.activity_main);8 9tv=(TextView) Findviewbyid (r.id.tv);Ten OneTv.settext (String.Format ("Taskid:%d\ncurrent Activity id:%s", GetTaskID (), toString ())); AFindviewbyid (R.ID.BTN). Setonclicklistener (NewView.onclicklistener () { - @Override - Public voidOnClick (View v) { theStartActivity (NewIntent (mainactivity. This, Mainactivity.class)); - } - }); - } + -}
2,singletop
Android Boot mode (three types)