0
所以我在讀從文檔的意圖過濾器的段落,但我真的不能明白爲什麼我們分開的意圖過濾器,像記事本項目的例子:android intent過濾器:爲什麼要將它們分開?
<activity android:name="NoteEditor"
android:theme="@android:style/Theme.Light"
android:label="@string/title_note" >
<intent-filter android:label="@string/resolve_edit">
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.EDIT" />
<action android:name="com.android.notepad.action.EDIT_NOTE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/vnd.google.note" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.INSERT" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.dir/vnd.google.note" />
</intent-filter>
</activity>
所以,我們只接受應該是VIEW,EDIT或EDIT_NOTE的操作? 以及爲什麼我們關閉此過濾器,併爲INSERT操作打開一個新過濾器?
感謝
謝謝;-)好吧它是有道理的,你可以給我一個「說明」的例子,其類型是「目錄」?這兩個數據有什麼區別? – Paul 2011-12-27 12:16:33
閱讀此內容,請獲取您的答案:http://developer.android.com/guide/topics/intents/intents-filters.html 「[...]意圖將包含匹配MIME類型的數據的URI vnd.android.cursor.dir/vnd.google.note - 即應放置備註的目錄的URI。「 – Sprigg 2011-12-27 12:53:17
好吧謝謝Sprigg – Paul 2011-12-28 00:35:39