Android uses intent to start common applications and services)

Source: Internet
Author: User

There are still many things to do after the Chinese New Year's Eve, and there is less blog writing than before. Please wait for time to add it!

Open the browser to display the webpage:
Uri uri = URI. parse ("http://www.ataaw.com ");
Intent intent = new intent (intent. action_view, Uri );
Startactivintenty (intent );

Display a map by map parameters:
Uri uri = URI. parse ("Geo: 38.899533,-77.036476 ");
Intent intent = new intent (intent. action_view, Uri );
Startactivintenty (intent );

Call dialingProgram:
Uri uri = URI. parse ("Tel: 13800138000 ");
Intent intent = new intent (intent. action_dial, Uri );
Startactivintenty (intent );

Send SMS/MMS by calling the SMS sending program
Intent intent = new intent (intent. action_view );
Intent. putextra ("sms_body", "ataaw. com ");
Intent. settype ("Vnd. Android-DIR/MMS-SMS ");
Startactivintenty (intent );

Call the SMS program to send text messages
Uri uri = URI. parse ("smsto: 13800138000 ");
Intent intent = new intent (intent. action_sendto, Uri );
Intent. putextra ("sms_body", "ataaw. com ");
Startactivintenty (intent );

Call the MMS service to send MMS messages
Uri uri = URI. parse ("content: // media/external/images/Media/exp ");
Intent intent = new intent (intent. action_send );
Intent. putextra ("sms_body", "ataaw. com ");
Intent. putextra (intent. extra_stream, Uri );
Intent. settype ("image/PNG ");
Startactivintenty (intent );

Start the email application to send an email
Uri uri = URI. parse ("mailto: ataaw.com@gmail.com ");
Intent intent = new intent (intent. action_sendto, Uri );
Startactivintenty (intent );

intent = new intent (intent. action_send);
intent. putextra (intent. extra_email, "android.sz@live.com");
intent. putextra (intent. extra_text, "email content. ");
intent. settype (" text/plain ");
startactivintenty (intent. createchooser (intent," Choose email client ");

intent = new intent (intent. action_send);
string [] TOS = {"ataaw.com@gmail.com"};
string [] CCS = {"cc@ataaw.com"};
intent. putextra (intent. extra_email, TOS);
intent. putextra (intent. extra_cc, CCS);
intent. putextra (intent. extra_text, "email content. ");
intent. putextra (intent. extra_subject, "subject");
intent. settype ("message/rfc822");
startactivintenty (intent. createchooser (intent, "Choose email client");

Add email attachment content
Intent intent = new intent (intent. action_send );
Intent. putextra (intent. extra_subject, "topic ");
Intent. putextra (intent. extra_stream, "file: // sdcard/ataaw.mp3 ");
Sendintent. settype ("audio/MP3 ");
Startactivintenty (intent. createchooser (intent, "Choose email client "));

Play MP4 multimedia files
Intent intent = new intent (intent. action_view );
Uri uri = URI. parse ("file: // sdcard/ataawcard ");
Intent. setdataandtype (Uri, "audio/MP3 ");
Startactivintenty (intent );

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.