Creating Intents with Action and Data

Appportunity

Build your own Android App Dev Empire

Get Instant Access

You've seen the simplest case to use an Intent to launch a class by name. Intents need not specify the component or class they want to launch explicitly. Instead, you can create an Intent Filter and register it within the Android Manifest file. The Android operating system attempts to resolve the Intent requirements and launch the appropriate Activity based on the filter criteria.

The guts of the Intent object are composed of two main parts: the action to be performed and the data to be acted upon.You can also specify action/data pairs using Intent Action types and Uri objects. As you saw in Chapter 3,"Writing Your First Android Application," a Uri object represents a string that gives the location and name of an object. Therefore, an Intent is basically saying "do this" (the action) to "that" (the Uri describing what resource to do the action to).

The most common action types are defined in the Intent class, including action_main (describes the main entry point of an Activity) and action_edit (used in conjunction with a Uri to the data edited).You also find Action types that generate integration points with Activities in other applications, such as the Browser or Phone Dialer.

Was this article helpful?

0 0
Easy Software Profits

Easy Software Profits

Here's How Anyone Can Start, Build and Run their Own Successful Software Empire Without Knowing the First Thing About Programming, Scripting Or Any 'Coder' Stuff. There is no doubt about it software sells. Software has a high percieved value and it solves problems for people.  A claim that can't always be made for PDF books, Video products and the like.

Get My Free Ebook


Post a comment