在Android的pre蜂窝清除backstack? [英] Clear backstack in Android pre Honeycomb?

查看:101
本文介绍了在Android的pre蜂窝清除backstack?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种简单的方法或其他变通方法来删除的Andr​​oid pre蜂窝(API级别11之前)backstack?人建议开始一个新的活动时使用FLAG_ACTIVITY_CLEAR_TOP与FLAG_ACTIVITY_NEW_TASK一起,但这只是删除我的当前位置,而不是在我的位置上的堆栈顶部堆栈。它不应该是很难从一个新的任务开始。这周围的一些想法?我不能使用FLAG_ACTIVITY_CLEAR_TASK,因为我需要支持API级别11.下面这些版本是否有一个相当于FLAG_ACTIVITY_CLEAR_TASK扫清整个导航backstack。或类似的东西来FLAG_ACTIVITY_REORDER_TO_FRONT的重新排序备份,然后我可以清除在它上面的一切。所有的建议都是非常AP preciated :)谢谢!

Is there an easy way or another workaround to delete the backstack in Android pre Honeycomb(before API level 11)? People suggest using the FLAG_ACTIVITY_CLEAR_TOP in conjunction with FLAG_ACTIVITY_NEW_TASK when starting a new activity, but this does only delete the stack on top of my current position, not the stack under my position. It should not be that hard to start from a fresh task. Some ideas around this? I can not use FLAG_ACTIVITY_CLEAR_TASK because I need to support those versions beneath api level 11. Is there an equivalent to FLAG_ACTIVITY_CLEAR_TASK that clears the whole navigation backstack. Or something similiar to FLAG_ACTIVITY_REORDER_TO_FRONT that reorders to back, and then I can clear everything on top of it. All suggestions are highly appreciated:) Thanks!

推荐答案

您也可以使用广播听众。

You can also use a broadcast listener.

只要在所有活动的广播听众以STRING来识别。

Just make a broadcast listener in all the activities with a "STRING" to recognise.

每当你想删除所有的活动,极大地激发意图。

Whenever you want to delete all the activities, fire the intent.

已注册为上述听者这些活动(由具体取决于activites你想完成来完成),将拦截,并会得到完成。

Those activities that have registered for the above listener (to be done by depending on which activites you wanna finish), will intercept that and will get finish.

这是在Android任何版本要去工作。

This is gonna work in any release of the Android.

这篇关于在Android的pre蜂窝清除backstack?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆