The relationship between Android intent and notification and home

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.