我想要在瀏覽器中訪問某個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