11
我想成立一個意圖過濾器來處理像URL: http://mysite.com/?action=delete&id=30492意圖過濾pathPrefix
我試圖建立我的intent-filter
如下:
<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:scheme="http" android:host="mysite.com" android:pathPrefix="/?action="/>
</intent-filter>
然而,這並未不起作用,我的應用程序無法識別爲能夠處理URL。我知道這是因爲我在做我的pathPrefix
錯誤,因爲當我刪除pathPrefix
它的作品。我也知道它與問號有關,因爲如果我從URL和pathPrefix
中刪除問號,它就會起作用。
我需要以某種方式逃避問號嗎?我試着用斜線(android:pathPrefix="/\?action="
)轉義,但那也行不通。
我該如何獲得這個意圖過濾器的工作?
Bummer,謝謝。 – 2010-12-02 01:43:57