Android Intent Components

Source: Internet
Author: User

It's a bad idea. Less than 10 lines of code applied to the original SMS phone


(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 of telephone interface

Uri reluri=uri.parse ("tel:100861");

Returnit=new Intent (Intent.action_dial,teluri);

(4) Call directly

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) Play

Uri playuri=uri.parse ("File:///sdcard/download/everything.mp3");

Returnit=new Intent (Intent.action_view,playuri);

(8) Calling outgoing mail

Uri emailuri=uri.parse ("Mailto:[email protected]");

Returnit=newintent (Intent.action_sendto,emailuri);

(9) E-mail

Returnit=newintent (Intent.action_send);

string[]tos={"[Email protected]"};

string[]cos={"[Email protected]"};

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) Texting

Uri smsuri=uri.parse ("tel:100861");

Returnit=newintent (Intent.action_view,smsuri);

Returnit.putextra ("Sms_body", "Shenrenkui");

(11) Send email directly

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

Returnit=newintent (Intent.action_sendto,smstouri);

Returnit.putextra ("Sms_body", "Shenrenkui");

(12) Send MMS

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");

Android Intent Components

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.