本文介绍了上后退按钮preSS的Android跳过活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个登录屏幕,其中在后,用户将被带到一个主屏幕的用户登录。
I have a login screen in which the user logs in. After that the user will be taken to a main screen.
现在我的问题是,当后退按钮是pressed用户带到登录界面了。
Now my problem is when the back button is pressed the user is taken to the login screen again.
有什么办法来解决这个问题呢?
Is there any way to fix this problem?
我已经打过电话完成()
之后 startActivity()
,但只取得了应用程序崩溃和没T似乎一个很好的解决办法。
I have tried calling finish()
right after startActivity()
but it only made the application crash and didn't seem a good solution either.
推荐答案
在清单中,添加安卓noHistory =真正的
作为登录活动的属性。
In the manifest, add android:noHistory="true"
as an attribute of the login activity.
这篇关于上后退按钮preSS的Android跳过活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!