Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 5: Understanding Intents > Exercising the ACTION_PICK

Exercising the ACTION_PICK

So far, we have exercised intents or actions that mainly invoke another activity without expecting a result back. Let's look at an action that is a bit more involved and returns a value after being invoked. ACTION_PICK is one such generic action.

The idea of ACTION_PICK is to start an activity that displays a list of items. The activity then should allow a user to pick one item from that list. Once the user picks the item, the activity should return the URI of the picked item to the caller. This allows reuse of the UI's functionality to select items of a certain type.

You should indicate the collection of items to choose from using a MIME type that points to an Android content cursor. The MIME type of this URI should look similar to the following:


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial