Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/204.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.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 使用IntentFilter处理HTTP Url_Android_Url_Android Intent_Intentfilter - Fatal编程技术网

Android 使用IntentFilter处理HTTP Url

Android 使用IntentFilter处理HTTP Url,android,url,android-intent,intentfilter,Android,Url,Android Intent,Intentfilter,我已经读了一些关于这个帖子的其他问题,但是没有人回答我的问题 我的情况如下:用户在任何应用程序(如Facebook、Gmail…)上点击URL,该URL包含http:\\www.意大利语subs.net/forum/…和一些其他参数。我希望应用程序能够处理该特定链接,因此,在网站上的其他一些问题之后,我尝试了以下方法: <intent-filter> <action android:name="android.intent.action.VIEW"/> &

我已经读了一些关于这个帖子的其他问题,但是没有人回答我的问题

我的情况如下:用户在任何应用程序(如Facebook、Gmail…)上点击URL,该URL包含
http:\\www.意大利语subs.net/forum/…
和一些其他参数。我希望应用程序能够处理该特定链接,因此,在网站上的其他一些问题之后,我尝试了以下方法:

<intent-filter>
    <action android:name="android.intent.action.VIEW"/>
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE"/>
    <data android:host="italiansubs.net" android:scheme="www" />
    <data android:host="italiansubs.net" android:scheme="http" />
</intent-filter>

但每次我用这种语法点击URL时,浏览器就会出现并打开链接。我需要接收该链接,然后让应用程序执行其他一些操作,但我的应用程序没有尽可能显示

我怎样才能使这个代码工作


谢谢。

主机的
值是URL中显示的完整域名。这可能意味着您需要一些
元素来处理
scheme
(如果链接可能使用
http
https
)和
host
foo.com
www.foo.com
wow.subdomains.are.cool.foo.com
等)的所有组合。

首先,
www
不是有效的方案,所以,去掉
元素。第二,您确定该链接是针对
http://italiansubs.net
,而不是
http://www.italiansubs.net
https://italiansubs.net
等。?此外,请记住,如何处理链接取决于应用程序,Web浏览器通常假定
http
/
https
链接应由浏览器自己处理。你使用了什么应用程序来测试链接?好吧,我的错,我想主机只是
italiansubs.net
,而不是
www.italiansubs.net
。谢谢你,伙计