Android Intent component and androidintent component

Source: Internet
Author: User

Android Intent component and androidintent component

Today, I only know that there are less than 10 lines of code in the text message phone application.


(1) tune the web browser

Uri myBlogUri = Uri. parse ("http://kuikui.javaeye.com ");

ReturnIt = new Intent (Intent. ACTION_VIEW, myBlogUri );

(2) Map

Uri mapUri = Uri. parse ('geo: 38.899533,-77.036476 ");

ReturnIt = new Intent (Intent. ACTION_VIEW, mapUri );

(3) Transfer call interface

Uri relUri = Uri. parse ("tel: 100861 ");

ReturnIt = new Intent (Intent. ACTION_DIAL, telUri );

(4) direct call

Uri uninstallUri = Uri. fromParts ("package", "xxx", null );

ReturnIt = new Intent (Intent. ACTION_CALL, callUri );

(5) uninstall

Uri uninstallUri = Uri. fromParts ("package", "xxx", null );

ReturnIt = new Intent (Intent. ACTION_DELETE, uninstallUri );

(6) Installation

Uri installUri = Uri. fromParts ("package", "xxx", null );

ReturnIt = new Intent (Intent. ACTION_PACKAGE_ADDED, installUri );

(7) playback

Uri playUri = Uri. parse ("file: // sdcard/download/everything.mp3 ");

ReturnIt = new Intent (Intent. ACTION_VIEW, playUri );

(8) Call email

Uri emailUri = Uri. parse ("mailto: shenrenkui@gmail.com ");

ReturnIt = newIntent (Intent. ACTION_SENDTO, emailUri );

(9) send an email

ReturnIt = newIntent (Intent. ACTION_SEND );

String [] tos = {"shenrenkui@gmail.com "};

String [] cos = {"shenrenkui@gmail.com "};

ReturnIt. putExtra (Intent. EXTRA_EMAIL, tos );

ReturnIt. putExtra (Intent. EXTRA_CC, ccs );

ReturnIt. putExtra (Intent. EXTRA_TEXT, "body ");

ReturnIt. putExtra (Intent. EXTRA_SUBJECT, "subject ");

ReturnIt. setType ("message/rfc882 ");

Intent. createChooser (returnIt, "ChooseEmail Client ");

(10) text messages

Uri smsUri = Uri. parse ("tel: 100861 ");

ReturnIt = newIntent (Intent. ACTION_VIEW, smsUri );

ReturnIt. putExtra ("sms_body", "shenrenkui ");

(11) Direct Mail

Uri smsToUri = Uri. parse ("smsto: // 100861 ");

ReturnIt = newIntent (Intent. ACTION_SENDTO, smsToUri );

ReturnIt. putExtra ("sms_body", "shenrenkui ");

(12) Send MMS messages

Uri mmsUri = Uri. parse ("content: // media/external/images/

Media/23 ");

ReturnIt = newIntent (Intent. ACTION_SEND );

ReturnIt. putExtra ("sms_body", "shenrenkui ");

ReturnIt. putExtra (Intent. EXTRA_STREAM, mmsUri );

ReturnIt. setType ("image/png ");

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.