Anil wrote:
> What if an intent matches two or more activities - how is it resolved?
> 
> In the example provided on the intents page,
> http://code.google.com/android/reference/android/content/Intent.html
> both Noteslist and NoteEditor have type
> 
> <type android:value="vnd.android.cursor.dir/vnd.google.note" />
> 
> So in the example, an intent like
> 
> { action=android.app.action.VIEW data=content://
> com.google.provider.NotePad/notes }
> 
> How can we be sure it will map to the the NotesList activity and not
> to the NoteEditor?

The MIME type is only one of the criteria used for determining if an 
Intent matches an IntentFilter.

Another is the action. In the cited example, NotesList responds to 
android.intent.action.GET_CONTENT for 
vnd.android.cursor.item/vnd.google.note, while NoteEditor responds to 
android.intent.action.VIEW and android.intent.action.EDIT for 
vnd.android.cursor.item/vnd.google.note.

So, if a VIEW intent for a note comes in, it will match NoteEditor 
(match on action and type) and not NotesList (match on type but not action).

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 1.9 Available!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to