2014-02-20 30 views
1

我試圖使用意圖過濾器打開我的活動,如果打開某個URL,無論是從掃描的QR碼,電子郵件中的鏈接或從Chrome瀏覽器或瀏覽器瀏覽到網站。這是從我的清單片段:當調用特定的URL時打開我的應用程序的意圖過濾器不起作用

<activity 
     android:name="com.openapp.projecttest.Main" 
     android:label="@string/app_name" > 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 
  <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
     <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.qwert.com" android:scheme="http"></data> 
     </intent-filter> 
    </activity> 

當我瀏覽到它在谷歌瀏覽器,它似乎並沒有觸發意圖過濾器。我是否錯過了許可?

+0

您使用的URL是否包含路徑?比如www.qwert.com/somePath – singularhum

+0

您能否提供一個您嘗試觸發過濾器的URL的示例? –

+0

它不適用於任何URL,但我已經認識到它現在可以通過鏈接工作,但如果通過瀏覽器瀏覽到URL,則不起作用 –

回答

0

它的工作從一個鏈接,但如果瀏覽通過瀏覽器的URL不起作用。

0

如果在數據過濾器中包含pathPattern,它應該通過瀏覽器鏈接工作。

android:pathPattern="/path/pattern" 

當然,你填寫的路徑和模式。

+0

它通過鏈接工作,我對如果您通過瀏覽器上的URL瀏覽到鏈接,請使其運行 –

相關問題