One, the explicit intent is as follows:
(1) The intent constructor passed in two activity file names
Intent Intent = new Intent (firstactivity.this, Secondactivity.class);
StartActivity (Intent);
(2) Remember to register for Secondactivity in Androidmanifest.xml
<activity android:name= "Secondactivity" >
</activity>
Second, the implicit intent is as follows:
(1) A string that directly passes the action
Intent Intent = new Intent ("Com.example.intentdemo.ACTION_START");
StartActivity (Intent);
(2) Remember to register in Androidmanifest.xml.
Only one action can be specified in each Intent, but it is possible to specify multiple category.
<activity android:name= ". Secondactivity ">
<intent-filter>
<action android:name= "Com.example.intentdemo.ACTION_START"/>
<category android:name= "Android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
Three. Open a Web page
Intent Intent = new Intent (Intent.action_view);
Intent.setdata (Uri.parse ("http://www.baidu.com"));
StartActivity (Intent);
Four. Call the system dial-up interface
Intent Intent = new Intent (intent.action_dial);
Intent.setdata (Uri.parse ("tel:10086"));
StartActivity (Intent);
Five. Passing data to the next activity
Intent intent=new Intent (firstactivity.this,secondactivity.class);
Intent.putextra ("Extra_data", "hello,secondactivity");
StartActivity (Intent);
Android Note: Intent