从历史堆栈中删除一个活动 [英] Removing an activity from the history stack

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

问题描述

我的应用程序显示了注册活动的用户运行该应用程序的第一次,是这样的:

My app shows a signup activity the first time the user runs the app, looks like:

  1. ActivitySplashScreen(欢迎到游戏,注册一个账号?)
  2. ActivitySplashScreenSignUp(伟大的,填写此信息)
  3. ActivityGameMain(游戏主画面)

所以活动发动彼此以完全相同的顺序,当用户点击通过在每个屏幕上的按钮。

so the activities launch each other in exactly that order, when the user clicks through a button on each screen.

当用户从活动#2#3,是否有可能消灭#1和#2完全关闭的历史堆栈?我想它,这样如果用户在#3,点击后退按钮,他们刚进去,而不是回闪屏到主屏幕。

When the user goes from activity #2 to #3, is it possible to wipe #1 and #2 off the history stack completely? I'd like it so that if the user is at #3, and hits the back button, they just go to the homescreen, instead of back to the splash screen.

我想我可以用任务完成这个(即启动一个新的任务#3),但想看看是否有更简单的方法,

I think I can accomplish this with tasks (ie. start a new task on #3) but wanted to see if there was simpler method,

感谢

推荐答案

您可以从您的的Andr​​oidManifest.xml 文件实现这一点,只需添加<一href="http://developer.android.com/reference/android/R.styleable.html#AndroidManifestActivity_noHistory">[<$c$c>android:noHistory="true"]这些属性 &LT;活性GT; 你想

You can implement this from your AndroidManifest.xml file, just adding [android:noHistory="true"] attribute in those <activity> you want.

这篇关于从历史堆栈中删除一个活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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