Intentions (Intent)
Java.lang.Object;
Android.content.intend;
Android.content.pm.LabeledIntent;
Mainly divided into Action Intent and broadcast intent,intent serve Android three core components: Activity, services, broadcast Receiver
How to handle Intent
Intent Start a new Activity
public void startmainactivity (view view) {finish (); final Intent Intent = new Intent (); Intent.setclass (testactivity.this , Mainactivity.class); startactivity (intent);}
Keep in mind that the finish should be placed in front so that only one activity is activated when multiple click Buttons Trigger Startmainactivity, and the bug is the switch between the activity!
In addition, StartActivity just starts a new activity, and Startactivityforresult is the result of getting the startup activity back, such as I want to call a friend's number in my address book, then I want to start the phone activity, and then start the contacts activity, After selecting a friend in the Address book, the result of the selection is returned to the phone activity by Onactivityresult in the phone activity, as the contact activity stops.
Read "Android from getting Started to mastering" (--intent)