Android开放活动,并关闭previous一 [英] Android Open Activity And Close Previous One

查看:205
本文介绍了Android开放活动,并关闭previous一的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,让我有一种加载屏幕,获取文件并没有什么,事情的应用程序需要的功能,然后当它完成加载启动的主要活动。然而,当你preSS回,又回到这显然我不希望加载的活动。

Alright so I have a loader screen which fetches files and what not, things the app needs to function and then when it's done loading it starts the main activity. However when you press back it goes back to the loading activity which obviously i don't want.

解决我设置了明显的机器人。但有这个问题,我的应用程序是根应用程序,所以需要在加载程序屏幕超级用户权限,并且在出现苏对话框,要求接受或拒绝的加载屏幕关闭,因为历史是关闭的,另一个应用程序采取了看法。我发现,如果我从清单中删除苏noHistory不会关闭我的应用程序,所以我知道它是什么。

Solution I set this in the manifest android:noHistory="true" for the loading screen activity. But there is an issue with this, my application is a root app so it needs superuser permissions in the loader screen and when the su dialog appears asking to accept or decline the loading screen closes since history is off and another app has taken the view. I have found that if i remove noHistory from the manifest su doesn't close my app so i know that's what it is.

所以最后一个问题则是,是否有一个标志或东西,我可以在设定的意图,保持装载机退出了历史时意图在年底推出后,我们已经获得超级用户权限,因为我需要保持装载机开的时候超级用户来了,但是当用户点击后面不希望它有

So the final question then is, is there a flag or something i can set on the intent to keep the loader out of history when the intent is launched at the end after we've gained superuser permissions cause i need to keep the loader open when superuser comes up but don't want it there when the user hits back

感谢您的帮助。

推荐答案

开始新一后完成的活动。

Finish the activity after starting the new one.

startActivity(intent);
finish();

这篇关于Android开放活动,并关闭previous一的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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