0
ので、私は、docからインテントフィルタの段落を読んでいたが、私たちはメモ帳のプロジェクトから、この例のように、インテントフィルタを分離し、なぜ私は本当に理解することはできません。android intent filter:なぜそれらを分けるのですか?
<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アクション用に新しいフィルタを開くのはなぜですか?
おかげ
ありがとう;-)それは意味がありますし、私はあなたのタイプが "dir"の "メモ"の例を教えてくれますか?これらの2つのデータの違いは何ですか? – Paul
これを読んで、答えを得てください:http://developer.android.com/guide/topics/intents/intents-filters.html "[...]インテントには、MIMEタイプに一致するデータのURIが含まれていますvnd.android.cursor.dir/vnd.google.note - つまり、メモを配置するディレクトリのURIです。 " – Sprigg
ありがとうSprigg – Paul