滞留在Flag_Activity_ClearTop [英] Stuck in Flag_Activity_ClearTop
问题描述
我坚持了使用活动标志清晰顶部使用英寸它创建了一个巨大的问题给我。有时工作,有时没有。我不跆拳道此事。这实在是困惑我。请帮助
I am stuck in the using the Flag activity clear top usage. It creates a huge problem to me. Sometimes it works and sometimes not. I dont wtf matter is. It is really confusing me. Please help
下面我从登录Acitivy去 - >活动A - >活动B-> InviteGroupViaPinEmailActivity->点击按钮,我打开一个警告对话框,并在此对话框的退出按钮的preSS,我打电话以下code。
Here I go from Login Acitivy -> Activity A -> Activity B->InviteGroupViaPinEmailActivity-> on the Button click, I am opening a Alert Dialog and on the press of Exit button of this dialog,I am calling the following code.
Intent userMenu = new Intent(InviteGroupViaPinEmailActivity.this,LoginActivity.class);
userMenu.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
userMenu.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(userMenu);
finish();
对于同时亮起LoginActivity,但是当我preSS回所有的活动,活动B->活性的研究一遍来,然后它最后退出。
For a while it comes on LoginActivity, But when I press back all the activities Activity B->Acitivity A again comes on, and then it is finally exited.
请告诉我问题。请帮帮我吧。
Whats the problem .Please help me.
推荐答案
我觉得你完成你的登录活性的研究,而你去LoginActivity - >活动A.当你使用上面清晰的标志那么你登录活动应该在活着你的筹码。请确保你没有完成您登录活动。
I think you finish your Login Acitivity while you go to the LoginActivity -> Activity A. When you are using clear top flag then your Login Activity should be alive in your stack. Please make sure that you are not finish your login activity.
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
Log.e("onkeyDown>>>>", "Called>>>>>");
finish();
}
return super.onKeyDown(keyCode, event);
}
这篇关于滞留在Flag_Activity_ClearTop的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!