我可以更改正在运行的活动的 android:noHistory 属性吗?
是否可以通过编程方式动态更改 Activity 的 android:noHistory
属性值?
或者也许有另一种方法可以做我想做的事。我有一个带有 QuickContactBadges 的活动...我希望它在弹出 QuickContact 后关闭该活动,这就是为什么我打开了 noHistory
,但该活动还启动了一个配置活动。我不希望它在从该活动回来时关闭(相反,它应该刷新,如果我可以阻止它关闭,我就可以做到这一点)。
Is it possible to change the value of the android:noHistory
attribute of an Activity programmaticaly and on the fly?
Or maybe there is another way to do what I want. I have an activity with QuickContactBadges on it... I want it to close the activity when after popping up a QuickContact, which is why I have noHistory
on, but the activity also launches a configuration activity. I do NOT want it to close when coming back from that activity (rather it should refresh, which I can do if I can stop it from closing).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
修订后的答案
您可以从默认布尔值
true
开始,将其用作 Activity 的onPause()
方法中的触发器来告诉您是否要调用finish()
。如果用户到达 Activity 中调用配置 Activity 的部分,请将布尔值设置为false
,这样 Activity 就不会完成,也不会从堆栈中删除。Revised Answer
You can start with a default boolean value of
true
to be used as a trigger in theonPause()
method of your Activity to tell you whether or not you want to callfinish()
. If the user reaches the portion of your Activity that calls your Configuration Activity, set the boolean tofalse
so the Activity will not be finished nor removed from the stack.试试这个链接->http://developer.android.com/guide/topics/manifest/activity-element.html
try this link->http://developer.android.com/guide/topics/manifest/activity-element.html