SoFunction
Updated on 2025-04-07

A summary of commonly used intent actions on Android

This article summarizes the common intent action functions of Android. Share it for your reference, as follows:

The basic design philosophy of Android is to encourage the reduction of coupling between components, so Android provides Intent (intention), Intent provides a universal messaging system that allows passing Intent between your application and other applications to perform actions and generate events. As a link between activities, Intent is not limited to simple data transmission. Through its own attributes, many more complex operations can be easily completed. For example, directly calling the dialing function, processing and receiving SMS, etc., can be done by setting the Intent attribute.

Intent has the following four important attributes, which are:

Action: The value of the Action property is a string, which represents a series of commonly used actions that have been defined in the system. Set it through the setAction() method or in the manifest file. The sample code (configured) that identifies the Activity as the beginning of a program is as follows:

<span style="font-size:16px;">
<intent-filter>
  <action android:name="" />
  <category android:name="" />
</intent-filter>
</span>

Data: Data is usually the operation data defined in the URI format. For example: tel://. Set by setData() method.
Category: The Category property is used to specify the environment in which the current action is executed. Set it through the addCategory() method or in the manifest file. The default is: CATEGORY_DEFAULT.
Extras: The Extras attribute is mainly used to pass the additional data required by the target component. Set by putExtras() method.

In this article, we mainly introduce the use of common actions. Action describes the string of the action name triggered by Intent. For BroadcastIntent, Action refers to the action that is broadcast. In theory, Action can be considered any string, and Action strings related to Android system applications are defined in the Intent class as static string constants. Actions include many types, such as incoming calls, outgoing calls, receiving text messages from teachers in class, etc. The following is a compilation of common system-related actions:

1. Intent.ACTION_MAIN

String:
Identifies the Activity as the beginning of a program.

2. Intent.Action_CALL

Stirng:

Call the specified phone number.

Intent intent=new Intent();
(Intent.ACTION_CALL);
(("tel:10086");
startActivity(intent);

3. Intent.ACTION_POWER_CONNECTED;

Broadcasts when plugged in with external power supply

4 Intent.ACTION_POWER_DISCONNECTED;

Broadcasts sent when external power connection has been disconnected

String:

Calling the dial panel

Intent intent=new Intent();
(Intent.ACTION_DIAL);
(("tel:10086");
startActivity(intent);

.ALL_APPS

String: .ALL_APPS

List all applications.

.ACTION_ANSWER

Stirng:

Process incoming calls.

8 .Intent.ACTION_BUG_REPORT

String: .BUG_REPORT

Show Dug report.

9. Intent.Action_CALL_BUTTON

String: .CALL_BUTTON.

It is equivalent to pressing the "Dial" key.

Intent intent = new Intent(Intent.ACTION_CALL_BUTTON);
startActivity(intent);

10. Telephony.SMS_RECEIVED

String: .SMS_RECEIVED

Receive SMS action

<intent-filter>
  <action android:name=".SMS_RECEIVED"/>
  <data android:host="localhost"/>
</intent-filter>

11. Intent.ACTION_GET_CONTENT

String: .GET_CONTENT

Allow users to select special types of data and return (special types of data: take a photo or record a sound)

12. Intent.ACTION_BATTERY_LOW;

String: .BATTERY_LOW

Indicates low battery power

13. Intent.ACTION_SEND

String:

The action of sending emails

14. Intent.ACTION_CALL_PRIVILEGED

String:.CALL_PRIVILEGED

Calling skype action

Intent intent = newIntent(".CALL_PRIVILEGED");
("",
"");
(("tel:" + phone));
startActivity(intent);

15. Intent.ACTION_CLOSE_SYSTEM_DIALOGS

When the screen timed out, when the user presses the power button, presses or presses for a long time (regardless of whether the dialog box is popped up), the Android system will broadcast this Action message when the screen is locked.

The above is a summary of common actions. There are actually many actions. If you want to use the ones not listed above, google.

For more information about Android related content, please check out the topic of this site:Android programming activity operation skills summary》、《Android resource operation skills summary》、《Android file operation skills summary》、《Summary of Android's SQLite database skills》、《Summary of Android operating json format data skills》、《Android database operation skills summary》、《A summary of SD card operation methods for Android programming and development》、《Android development introduction and advanced tutorial》、《Android View View Tips Summary"and"Android control usage summary

I hope this article will be helpful to everyone's Android programming design.