Active startup mode: 1.standard 2.singleTop 3.singleTask 4.singleInstance------- can be passed to <activity> in Androidmanifest LABEL specifies the Android:launchmode property to select the startup mode
Standard (1) The default startup mode each time a new instance of the activity is created on the return stack there can be 3 identical activities, so press three times back to exit the return stack but a a aSingletop (2) If it is found that the stack top of the return stack is already the activity, it can be used directly and will not create a new instance return stack can be a B a not aSingletask (3) guarantees that there is only one instance of the stack, that is, only one stack in the back stack can have one stack.SingleInstance (4) solves the problem of shared instances regardless of which application is accessing the activity, share the same return stack a->b->c this point 3 times back is c->a->b-> exit the entire process: A-> ; B->c->a-b-> exit
Startup mode for Android activity