so i was reading the intent-filters paragraph from the doc, but i can’t really understand why we separate the intent filters, like this example from the NotePad project :
<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>
So, we only accept an action that should be VIEW, or EDIT, or EDIT_NOTE ?
and why do we close this filter, and open a new one for the INSERT action?
Thanks
We need to close an
intent-filterand add a new one for INSERT, because INSERT needs other data than the otheractions. look at the differentmimeTypesin thedata