Simple usage of Intent
Intent some simple usage
Pass Value:
Intent intent=new Intent ();
Intent.putextra ("Extra", "This is the value of page one!") ");
Intent.setclass (Test_for_intentactivity.this, Actpage2.class);
StartActivity (Intent);
Value:
Intent intent=getintent ();
String Stringe=intent.getstringextra ("Extra");
TextView text2= (TextView) Findviewbyid (R.ID.TEXTVIEW2);
Text2.settext (Stringe);
Open Web page
-
Uri uri = uri.parse ("http://www.google.com");
-
Intent it
= new Intent (Intent.action_view,uri);
-
StartActivity (IT);
Call
uri Uri =uri.parse ("tel:xxxxxx");
startactivity (it);
 
6. Call the program to send text messages
intent it = newintent ( Intent.action_view);
it.putextra ("Sms_body", "TheSMS text");    
it.settype ("vnd.android-dir/mms-sms");
startactivity (IT);
-
Send Attachments
-
Intent it = new Intent (intent.action_send);
-
It.putextra (Intent.extra_subject, "The email SUBJECT text");
-
It.putextra (Intent.extra_stream, "File:///sdcard/eoe.mp3");
-
Sendintent.settype ("Audio/mp3");
-
StartActivity (Intent.createchooser (it, "Choose Email Client"));
This article is from the "Ahu-on-the-road" blog, be sure to keep this source http://xiaocool.blog.51cto.com/1593956/1618440
The use of Android learning--intent