Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 使用内容提供程序调用web浏览器_Android - Fatal编程技术网

Android 使用内容提供程序调用web浏览器

Android 使用内容提供程序调用web浏览器,android,Android,我是一名混合应用程序开发人员,希望开发一款android应用程序。我是新安卓。我想在web浏览器中打开给定的链接。我将在javascript的混合应用程序中执行以下操作 <a href="www.google.co.in">www.google.co.in</a> 我需要在android中实现这一点。我应该怎么做?你应该使用意图 Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("www.google

我是一名混合应用程序开发人员,希望开发一款android应用程序。我是新安卓。我想在web浏览器中打开给定的链接。我将在javascript的混合应用程序中执行以下操作

<a href="www.google.co.in">www.google.co.in</a>

我需要在android中实现这一点。我应该怎么做?

你应该使用意图

 Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("www.google.co.in"));
 startActivity(intent);
意图:

@giacomoni的链接也很棒(来自android教程):


我现在在打电话,所以我无法在Java代码中添加链接,这些链接负责按钮(或任何其他元素)的单击事件:

Intent intent = new Intent(Intent.ACTION_VIEW).setData(Uri.parse("www.google.co.in"));      
startActivity(intent); 

以下是实施上述措施的cod。在任何函数中添加以下代码

Intent i = new
Intent(android.content.Intent.ACTION_VIEW,
Uri.parse(“http://www.amazon.com”));
startActivity(i);
此链接也很有用: