我想要在浏览器中访问某个HTML URL时尝试放置一个意图过滤器来启动我的应用程序。当它是标准网址时,我没有问题,例如www.stonyx.com。使用Android Intent过滤器匹配URL中的HTTP参数
但是,我需要匹配一个URL与HTTP参数,如www.stonyx.com/?pagename,它是后面的部分?我遇到了匹配问题。
我采用了android尝试:路径,机器人:pathPrefix,和android:pathPattern,和他们都不做,我...不知道,如果是因为我做错了什么,或者如果它只是因为它是一个带有问号的php路径。任何帮助,高度赞赏。
P.S.这是我目前的意图过滤器看起来像
<intent-filter>
<action android:name="android.intent.action.VIEW"></action>
<category android:name="android.intent.category.DEFAULT"></category>
<category android:name="android.intent.category.BROWSABLE"></category>
<data android:host="www.megaupload.com" android:scheme="http"></data>
</intent-filter>
只是想让你知道,如果你确实想得到参数,你总是可以从“data”元素中解析出来,它会给你整个URI。使用getIntent()。getData()来获取URI。 – PaulP