Now to do similar, no matter from which page into the chat interface, the return is the main interface relationship.
Assuming that there is main,a,chat, three AC, in order to achieve the above effect, the simplest way for Chat to return is to rewrite back processing, such as main launchmode is singletop, return when using intent point to main, add clear TOP Flaf This way, it clears the main above all AC, resulting in a kind no matter where to enter the chat interface, all return to the effect of the main page, note that the chat page should be configured as singleinstance, to avoid generating multiple chat pages.
Here, we solved the problem of returning to main AC regardless of where it came from, but this time it will come back to the main page from the chat page, then go to the other page A, return to the home, then into the app, then, will be reborn into a main page, this time, The AC stack situation is main,a,main, which is obviously not the effect we want
Why this is so, this involves intent action catxx two properties, Android in processing from the home into the app, Detects the action of the target active and whether the Catageroy property is consistent with the androidmanifest.xml, and if it is consistent, simply move the entire AC stack to the foreground, or create a new one, note that if it is singletask, it is not the same. Singletask will clean all AC on main, but this is not the effect we want.
So, in chat, return the intent of main to add and start the consistent action and catagory.
The relationship between Android intent and notification and home