简体   繁体   English

无法返回上一个活动

[英]can't go back to the previous activity

This is how my app opens a page in default browser 这是我的应用程序在默认浏览器中打开页面的方式

Intent i = Intent.parseUri("http://www.google.com", Intent.URI_INTENT_SCHEME);
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(i);

Once the browser activity is active, I can't navigate back to my app using back button. 一旦浏览器活动处于活动状态,就无法使用“后退”按钮导航回我的应用程序。 It goes the activity before my app. 它在我的应用程序之前开始活动。 My app/activity is not destroyed though as I can still resume it from the app list. 我的应用程序/活动没有被破坏,因为我仍然可以从应用程序列表中恢复它。 I suspect my activity is 'removed' from the back stack somehow. 我怀疑我的活动以某种方式从后排“移走了”。 Please help me debug/fix this. 请帮助我调试/修复此问题。 Thanks. 谢谢。

try to use Intent.ACTION_VIEW 尝试使用Intent.ACTION_VIEW

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(myUrl));
startActivity(intent);

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

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