Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.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 当我使用Intent与Chrome共享url时,会多次显示“选择器”_Android_Google Chrome - Fatal编程技术网

Android 当我使用Intent与Chrome共享url时,会多次显示“选择器”

Android 当我使用Intent与Chrome共享url时,会多次显示“选择器”,android,google-chrome,Android,Google Chrome,我的代码: String youtube = "https://www.youtube.com/watch?v=Rk6_hdRtJOE"; Intent intent = new Intent(Intent.ACTION_VIEW,Uri.parse(youtube)); startActivity(intent); 奇怪的是,这种情况只发生在Chrome上。如果我使用Opera或Firefox,我没有问题 有人知道会发生什么吗?如果Chrome不是默认浏览器,当站点重定向到移动版本时,它将

我的代码:

String youtube = "https://www.youtube.com/watch?v=Rk6_hdRtJOE";

Intent intent = new Intent(Intent.ACTION_VIEW,Uri.parse(youtube));
startActivity(intent);
奇怪的是,这种情况只发生在Chrome上。如果我使用Opera或Firefox,我没有问题


有人知道会发生什么吗?

如果Chrome不是默认浏览器,当站点重定向到移动版本时,它将再次显示选择器。您可以通过更改URL来避免这种情况

String youtube = "https://m.youtube.com/watch?v=Rk6_hdRtJOE";

谢谢非常简单的解决方案。