Intent is an important way to jump through components in Android, and is generally pathetic for scenarios such as initiating activities, starting services, and sending broadcasts.
#显示Intent
Primarily used to start a known component
Sending party
Intent Intent = new Intent (firstactivity.this, Secondactivity.class);
Intent.putextra ("Extra_data", data);
StartActivity (Intent);
Receiving party
Intent Intent = Getintent ();
String data = Intent.getstringextra ("Extra_data");
# Hidden Show Intent
(1) Action
(2) Category
(3) Data:scheme, host, path, type
Intent Intent = new Intent ("Com.example.activitytest.ACTION_START");
Intent.addcategory ("Com.example.activitytest.MY_CATEGORY");
If you do not add category, default is used
StartActivity (Intent);
Androidmanifest.xml
Used to respond to intent
<activity android:name= ". Secondactivity ">
<intent-filter>
<action android:name= "Com.example.activitytest.ACTION_START"/>
<category android:name= "Android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
# #使用Intent启动浏览器
Intent Intent = new Intent (Intent.action_view);
Intent.setdata (Uri.parse ("http://www.baidu.com"));
StartActivity (Intent);
Android Review notes--intent