FLAG_ACTIVITY_SINGLE_TOP
If set, the activity will not be launched if it is already running at the top of the history stack.
因此,如果当前活动不在历史堆栈的顶部,它将被重新启动。
FLAG_ACTIVITY_CLEAR_TOP
If set, and the activity being launched is already running in the current task, then instead of launching a new instance of that activity, all of the other activities on top of it will be closed and this Intent will be delivered to the (now on top) old activity as a new Intent.
默认情况下
TabActivity
setDefaultTab
通过密码改变。TabHost中的每个选项卡也是一个新的
Intent
如果我像这样编译,然后点击
在通知上,它会打开一个新的
第一个选项卡上的选项卡活动。如果我
点击后退,我得到很多错误
等等)。
这正在发生
我想
意图
是tab4(实际上是#3,0,1,2,3),并且您的通知会显示
tabactivity.class
. 因为它不是活动的或在堆栈顶部,所以它顶部的每个动作都是关闭的,包括tab4。
以下:我打开我的应用程序,转到
选项卡Activity,打开选项卡4,单击record。
如果我点击后退,它应该会隐藏
如果我点击
主页按钮。但是有一个
通知。如果我点击那个,
它应该只显示隐藏的
再活跃一次就这样了。那么,什么
我做错了吗?我以为
标记活动清除顶部和顶部
有什么问题吗?
home
和
back
钥匙。打
将隐藏您的活动,并且通知应该可以很好地处理这些标志(一旦您解决了我前面提到的问题)。当你击中
后面
不过,Android结束了当前的趋势
Activity
把它从纸堆上取下来。因为它下面没有任何内容,所以当您按下通知时,您必须从头开始重新启动。