Android浏览器意图后退按钮 [英] Android Browser Intent back button

查看:78
本文介绍了Android浏览器意图后退按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我正在使用以下意图从应用程序启动浏览器:

String url = "XXXX";
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);

但是当我在浏览器上按回时,我想返回到我的应用程序,而不是转到浏览器的选项.我该如何控制这种行为?

解决方案

您不能,因为后退按钮的实现现在受 Browser Application (浏览器应用程序)的控制.

在应用程序中实现WebView并处理按下返回键是唯一的选择.

Hello I am lauching the browser from my application using an intent such as:

String url = "XXXX";
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);

but when I press back on the browser i want to go back to the my application, instead of going to the options of the browser. how can i control this behaviour?

解决方案

You can't as the back button implementation is now under control of Browser Application.

Implement a WebView in your application and handle Back Key Pressed is the only option.

这篇关于Android浏览器意图后退按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆