Android-intent. action (1)

Source: Internet
Author: User

 

1 intent. action_main

String: Android. Intent. Action. Main

Identifies activity asProgram. It is commonly used.

Input: Nothing

Output: Nothing

For example:

1 < Activity Android: Name = ". Main" Android: Label = "@ String/app_name" >
2 < Intent-Filter >
3 < Action Android: Name = "Android. Intent. Action. Main"   />
4 < Category Android: Name = "Android. Intent. Category. launcher"   />
5 </ Intent-Filter >
6 </ Activity >

2 intent. action_call

Stirng: Android. Intent. Action. Call

Call the specified phone number.

Input: phone number. Data format: Tel: + phone number 

Output: Nothing

Intent intent = New Intent ();
Intent. setaction (intent. action_call );
Intent. setdata (URI. parse ( " Tel: 1320010001 " );
Startactivity (intent );

3 intent. Action. Dial

String: Action. Intent. Action. Dial

Call dial-up panel

Intent intent = New Intent ();
Intent. setaction (intent. action_dial ); // Android. Intent. Action. Dial
Intent. setdata (URI. parse ( " Tel: 1320010001 " );
Startactivity (intent );

Input: phone number. Data format: Tel: + phone number

Output: Nothing

Note: Open the dialing UI of Android. If no data is set, an empty UI is opened. If data is set, action. Dial calls getdata () to obtain the phone number.

However, the data format of the phone number is Tel: + phone number.

 

4. Intent. Action. all_apps

String: andriod. Intent. Action. all_apps

List all applications.

Input: Nothing.

Output: Nothing.

 

5. Intent. action_answer

Stirng: Android. Intent. Action. Answer

Handle incoming calls.

Input: Nothing.

Output: Nothing.

 

6 intent. action_attach_data

String: Android. Action. attch_data

Do not specify that some data should be attached to other places. For example, image data should be attached to contacts.

Input: Data

Output: Nothing

 

7 intent. action_bug_report

String: Android. Intent. Action. bug_report

Display dug reports.

Input: Nothing

Output: Nothing

 

8 intent. action_call_button

String: Android. Action. Intent. call_button.

The user presses the "dial" key. The test shows "call history"

Input: Nothing

Output: Nothing

Intent intent =   New Intent (intent. action_call_button );
Startactivity (intent );

 

 

9 intent. action_chooser

String: Android. Intent. Action. chooser

Display an activity selector that allows users to select what they want before the process, corresponding to intent. action_get_content.

 

10. Intent. action_get_content

String: Android. Intent. Action. get_content

Allow users to select special types of data and return (special types of data: Take a photo or record a piece of audio)

Input: Type

Output: URI

I have used this before. Let's look at the example.

Select an image:

Code

Int Requestcode =   1001 ;

Intent intent =   New Intent (intent. action_get_content ); // "Android. Intent. Action. get_content"
Intent. settype ( " Image /* " ); // View type. If it is another video type, replace it with video/* or */*
Intent wrapperintent = Intent. createchooser (intent, Null );
Startactivityforresult (wrapperintent, requestcode );

 

You can override onactivityresult to obtain the selected data content.

 

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.