2011-12-19 58 views

回答

0

您可以在清單中使用意圖過濾器。在這裏閱讀手冊:http://developer.android.com/guide/topics/intents/intents-filters.html

或檢查這個例子,我從SO(Android Respond To URL in Intent

<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.youtube.com" android:scheme="http"></data> 
</intent-filter> 

你不需要的方式任何特殊權限了。

+0

Talk聊天應用程序是否一樣?什麼應該是'android:host'和'android:scheme'? – Chandana 2011-12-19 15:25:50

+0

取決於您想要過濾的內容。如果你不想過濾任何你不需要指定的東西,那麼你會觸發這個類別的所有意圖。你讀過關於意向過濾器的鏈接嗎? – Nanne 2011-12-19 15:37:29

+0

是的,我已閱讀該帖子。但是這個解決方案對我不起作用。當我去YouTube時,我的新活動沒有被調用。 – Chandana 2011-12-19 16:10:49

相關問題