2011-08-12 81 views
0

我需要從瀏覽器打開我的應用程序時,一些模式匹配的網址來,我已經實現使用Intercepting links from the browser to open my Android app。它只用於URL纔可能打開應用程序。我想要應用程序時瀏覽器找到像appname:// id = 102這樣的字符串。Android:從瀏覽器打開應用程序

謝謝。

編輯:請看看這個代碼,我有使用

<intent-filter > 
       <category android:name="android.intent.category.BROWSABLE" /> 
       <action android:name="android.intent.action.VIEW" /> 
       <category android:name="android.intent.category.DEFAULT" /> 

       <data 
        android:scheme="appname" 
       />  
    </intent-filter> 

回答

1

您需要添加一個意圖過濾器適用於包含數據標籤的活動。在數據標籤中,您可以設置您想要聽的方案。這樣的事情:

<intent-filter> 
    <data android:scheme="appname" /> 
</intent-filter> 
+0

我已經做到了,但它不工作 –

相關問題