2012-06-09 25 views
1

我對Android知之甚少,所以請原諒,如果這個問題沒有得到正確的解答。設置尋找變量的意圖

我試圖設置打開時,選擇一個url我的應用程序的意圖..我的代碼如下:

 <intent-filter> 
      <data android:scheme="http" android:host="something.com" android:pathPattern=".*p=.*" /> 
      <action android:name="android.intent.action.VIEW" /> 
      <category android:name="android.intent.category.DEFAULT" /> 
     </intent-filter> 

和它完美的作品 - 但我只想啓動應用程序,如果URL中有一個變量「p」。意思是:不要啓動http://something.com/ok但啓動http://something.com/ok/?p=100

我想我需要添加android:pathPattern屬性並查找「p =」?有人可以幫忙嗎?

回答

0

爲此,您可以使用intent過濾器的pathPattern屬性。 (See the reference here.)

+0

真棒,很高興我在正確的道路上。任何提示模式應該是什麼樣子? – Henry

+0

請閱讀文檔,他們給出的例子,它可能會像* p = *或類似的東西... –

+0

,應該是明星p =明星 –