0
我希望能夠顯示我自己的日曆事件,給定Android意圖和日期顯示。我相信,意圖這樣做看起來是這樣的:如何捕捉Android View日曆事件的意圖?
Intent { act=android.intent.action.VIEW act=content://com.android.calendar/time/1409565898789 }
而且我已經設置了活動來處理這個意圖,在我的AndroidManifest.xml這樣規定的意圖過濾器:
<activity
android:name=".MyActivity"
android:label="@string/title_activity_custom"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
<!-- etc. -->
</activity>
在爲了測試這個代碼,我打開我的應用到我的測試設備和使用該命令發出意圖:
adb shell am start -a android.intent.action.VIEW -d content://com.android.calendar/time/1410665898789
但是,當我做到這一點,股票的Android日曆啓動。我從來沒有機會在另一份申請中看到這一次。我想也許Android系統甚至不認可我的Activity作爲接受這個Intent的候選人。
我不確定我做錯了什麼,我的搜索沒有找到我正在尋找的答案。有誰知道我錯過了什麼?
謝謝你,這個伎倆。我一直認爲,對於content:方案數據,我不需要在我的中提供標籤。謝謝你讓我挺直。 –
2014-09-29 23:13:17