Android 打开 Activity 并关闭上一个 Activity
好吧,我有一个加载器屏幕,它可以获取文件以及应用程序需要运行的东西,然后当加载完成时,它会启动主要活动。但是,当您按回时,它会返回到加载活动,这显然是我不想要的。
解决方案我在清单 android:noHistory="true" 中为加载屏幕活动设置了此项。但这有一个问题,我的应用程序是根应用程序,因此它需要加载程序屏幕中的超级用户权限,当出现 su 对话框要求接受或拒绝加载屏幕时,加载屏幕会关闭,因为历史记录已关闭并且另一个应用程序已获取视图。我发现,如果我从清单中删除 noHistory su 不会关闭我的应用程序,所以我知道它是什么。
所以最后的问题是,在我们获得超级用户权限后,当意图最后启动时,我是否可以在意图上设置一个标志或其他东西,以使加载程序不进入历史记录,因为我需要在以下情况下保持加载程序打开:超级用户出现,但当用户回击时不希望它出现
谢谢您的帮助
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.
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
Thank you for any help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
开始新的活动后完成该活动。
Finish the activity after starting the new one.