繁体   English   中英

FLAG_ACTIVITY_CLEAR_TOP在5.0+设备上不起作用

[英]FLAG_ACTIVITY_CLEAR_TOP not working on 5.0+ devices

从登录活动过渡到主应用程序时,我使用FLAG_ACTIVITY_CLEAR_TOP意向标志清除堆栈-一切在4.x设备中均正常运行,但在棒棒糖上则无法正常工作。 只是添加一些代码,这就是我所说的:

Intent intent = new Intent(this, MyActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);

我尝试过结合使用FLAG_ACTIVITY_NEW_TASK标志,但这也无济于事。

尝试以下标志:

intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);

用这个

   intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP|Intent.FLAG_ACTIVITY_SINGLE_TOP);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM