简体   繁体   中英

Intent-filter Browsable for and android Application, not Activity?

In iOS, there is a way to register custom scheme, and it is possible to open a whole app, like new instance or one with some app state (running) and it is not just a single ViewController.

For Android i am looking for a way to have whole stack of activity recovered (that might be launched before launching a browser) after user clicks a link that redirects to my app.

I don't want user to have to tap back till he closes the browser and goes back to my app activities, and I don't want to launch just single derived activity - but just go back to my app activity stack with the new one on the top.

Is this possible to achieve in some neat and clean way? Or at least clean activities of the app that were launched before a browser where user clicks a link that opens my app's activity?

Ok, the solution was to create launching activity that would be browsable. This activity would then launch desired activity with flags :

Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK

and immediately finish itself...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM