结算活动堆栈 [英] Clearing Activity Stack

查看:168
本文介绍了结算活动堆栈的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法清除我的应用程序的活动栈。在我的应用程序开始我让用户登录,并给他们一个会话ID。他们登录后,他们能够继续使用的应用程序。然而,如果有会话到期我想将它们重​​定向到登录活动并清除活动历史所以它们不能访问该应用。我看了看在Android API和意图的标志 FLAG_ACTIVITY_CLEAR_TASK 似乎是想,但我想这只是包含在API级别11,没有手机有新的操作系统呢。有没有人有办法解决这个问题。谢谢你。

I am having trouble clearing my app's activity stack. At the start of my app I make the user login and give them a session id. After they login they are able to continue on using the app. However if there session expires I want to redirect them to the login activity and clear the Activity history so they can't have access to the app. I looked at the Android API and the Intent flag FLAG_ACTIVITY_CLEAR_TASK seems to be want I want but it was just included in API level 11 and no phones have the new OS yet. Does anyone have a solution to this problem. Thanks.

推荐答案

我发现我的答案<一href="http://stackoverflow.com/questions/3007998/on-logout-clear-activity-history-stack-$p$pventing-back-button-from-opening-lo">here.事实证明,我有广播的意图告诉所有的活动中来调用方法完成()

I found my answer here. Turns out that I have to broadcast an intent to tell all of the Activities to call the method finish().

这篇关于结算活动堆栈的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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