Bamboo wrote: > From what I can see there are several different methods for navigating > from one activity to another using intents > > - Explicit intents (setClass(context, class)) > - Implicit intens (specifying actions, categories) > > Is one preferable to the other and are there specific conditions under > which each should be called. e.g user explicit intents if the class > name is known?
Let's draw an analogy: On your desktop, you have written an application that has downloaded an MP3 file from someplace, and you want to play that MP3. You have three choices: 1. Implement MP3-playback in your application. That's doable, but your MP3 player will inevitably be limited compared to any sort of full-featured player the user already has installed. 2. You can hard-code a path to an MP3 player executable, or do some sort of a "find" operation to find the executable, then run the MP3 player executable yourself. 3. You can let the operating system figure out how to handle MP3 playback using the default viewer for that platform. Using an explicit Intent is akin to #1 or #2 above -- you are telling Android to run a specific piece of logic. Using an implicit Intent is akin to #3 above -- you are telling Android to take an action on a piece of content, but you are letting Android figure out which is the right code to use for that task. -- Mark Murphy (a Commons Guy) http://commonsware.com _The Busy Coder's Guide to Android Development_ Version 2.0 Published! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---

