Native Android Actions

Native Android applications also use Intents to launch Activities and sub-Activities.

The following (noncomprehensive) list shows some of the native actions available as static string constants in the Intent class. When creating implicit Intents, you can use these actions, known as Activity Intents, to start Activities and sub-Activities within your own applications

ACTION_ALL_APPS — Opens an Activity that lists all the installed applications. Typically, this is handled by the launcher

ACTION_ANSWER — Opens an Activity that handles incoming calls. This is normally handled by the native in-call screen

ACTION_BUG_REPORT — Displays an Activity that can report a bug. This is normally handled by the native bug-reporting mechanism

ACTION_CALL — Brings up a phone dialer and immediately initiates a call using the number supplied in the Intent’s data URI. This action should be used only for Activities that replace the native dialer application. In most situations it is considered better form to use ACTION_DIAL

ACTION_CALL_BUTTON — Triggered when the user presses a hardware “call button.” This typically initiates the dialer Activity.

ACTION_DELETE — Starts an Activity that lets you delete the data specified at the Intent’s data URI

ACTION_DIAL — Brings up a dialer application with the number to dial prepopulated from the Intent’s data URI. By default, this is handled by the native Android phone dialer. The dialer can normalize most number schemas — for example, tel:555-1234 and tel:(212) 555 1212 are both valid numbers

ACTION_EDIT — Requests an Activity that can edit the data at the Intent’s data URI.

ACTION_INSERT — Opens an Activity capable of inserting new items into the Cursor specified in the Intent’s data URI. When called as a sub-Activity, it should return a URI to the newly inserted item

ACTION_PICK — Launches a sub-Activity that lets you pick an item from the Content Provider specified by the Intent’s data URI. When closed, it should return a URI to the item that was picked. The Activity launched depends on the data being picked — for example, passing content://contacts/people will invoke the native contacts list.

ACTION_SEARCH — Typically used to launch a specific search Activity. When it’s fi red without a specific Activity, the user will be prompted to select from all applications that support search. Supply the search term as a string in the Intent’s extras using SearchManager.QUERY as the key

ACTION_SEARCH_LONG_PRESS — Enables you to intercept long presses on the hardware search key. This is typically handled by the system to provide a shortcut to a voice search.

ACTION_SENDTO — Launches an Activity to send data to the contact specified by the Intent’s data URI.

ACTION_SEND — Launches an Activity that sends the data specified in the Intent. The recipient contact needs to be selected by the resolved Activity. Use setType to set the MIME type of the transmitted data. The data itself should be stored as an extra by means of the key EXTRA_TEXT or EXTRA_STREAM, depending on the type. In the case of email, the native Android applications will also accept extras via the EXTRA_EMAIL, EXTRA_CC, EXTRA_BCC, and EXTRA_SUBJECT keys. Use the ACTION_SEND action only to send data to a remote recipient (not to another application on the device)

ACTION_VIEW — This is the most common generic action. View asks that the data supplied in the Intent’s data URI be viewed in the most reasonable manner. Different applications will handle view requests depending on the URI schema of the data supplied. Natively http: addresses will open in the browser; tel: addresses will open the dialer to call the number; geo: addresses will be displayed in the Google Maps application; and contact content will be displayed in the Contact Manager.

ACTION_WEB_SEARCH — Opens the Browser to perform a web search based on the query supplied using the SearchManager.QUERY key.

Leave a Comment