1. When jumping from one activity to another, use the StartActivity (Intent) method
2. A Intent object contains a set of information
Componet Name: The name of another activity
Action: Specify what the other activity will do
Data: Transferred from one activity to another activity
Category (later)
Extras
Flags (later)
Intent similar to request in WebApp
3. Click button to jump to activity sample code
MyButton = (Button) Findviewbyid (R.id.mybutton);
Mybutton.setonclicklistener (New Mybuttonlistener ());
The OnClick method of overwrite Onclicklistener
public void OnClick (View v) {
Intent Intent =a New Intent ();
Intent.setclass (Activity02.this, Otheractivity.class);
Intent.putextra ("Testintent", "" ");
Activity02.this.startActivity (Intent);
---------------------------------------------
Uri uri = uri.parse ("smsto://0800000123");
Intent Intent = new Intent (intent.action_sendto, URI);
Intent.putextra ("Sms_body", "The SMS Text");
StartActivity (Intent);
}
Take it on the other side
Intent Intent = Getintent ();
String value = Intent.getstringextra ("testintent");
Miscellaneous notes:
@+id Add a resource ID
@id and Android:id, referencing an existing resource ID