I'm developing a SDK with a single Activity that's started with the following flags:
FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_SINGLE_TOP | FLAG_ACTIVITY_CLEAR_TOP | FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS
Everything works as expected (ie there's a single instance of the Activity that receives all Intents; the user can't navigate back to it) except for one case.
If I start the Activity & then finish the one that started it, the app disappears from the recent apps list.
How do I prevent that from happening?
Becuase of this flag its not appearing.
FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS
Remove it and try..
if you mentioned above flag then The App will not shown in the recent Apps list..
指定android:taskAffinity="org.example.app"
解决了这个问题。
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.