0

I have this challenge with my Android APP:

I have and "dialog" - I mean an activity created as a dialog. Now, user presses the home button and leaves the app ~ later holds the home button and displays the Recent apps list. He will see the dialog as the last activity of my app. However, I don't want to display this activity on the "stack".

I tried the exceludeFromRecentApps (or similar name) and this one enabled removes whole app from the list. But I want to have dialog's parent activity displayed in the list. I tried something with overriding the onResume, onPause and onStop methods, but no effect for me, since instance-level variables may be discarded (?). I believe thats trivial problem, but I wasn't able to google working solution.

Lot of thanks!

4

2 回答 2

4
android:noHistory="true"
android:taskAffinity=""
android:excludeFromRecents="true"

对于您的情况,首先您需要通过“taskAffinity”标签分隔您的对话活动。然后,您需要 AndroidManifest.xml 中的“excludeFromRecents”标签从最近列表中删除。

于 2014-03-02T10:30:10.360 回答
0

就像Hoan Nguyen说的那样,您需要使用该finish()方法,但要知道该finish()方法并不能保证 Activity 将完成。

于 2013-08-18T18:29:32.600 回答