/Explicit Intent: You must specify the full package name and class name of the component to be activated (the application is coupled together)
When you normally activate your application's components, you use the
Implicit intent: You only need to specify the actions and data you want (there is no coupling between the benefits of the application)
Activate the app's implicit intent, without caring for the package name and class name of the other person.
1.Manifest
<activity android:name= "com.itheima.intent2.SecondActivity" ><intent-filter><action android:name= " Com.itheima.intent2.open2 "/><!--behavior (dozen)--><category android:name=" Android.intent.category.DEFAULT "/ ><data android:mimetype= "Application/person"/><!--data type (soy sauce)--><data android:scheme= "Jianren"/ ><!--type constraint, description--
</intent-filter> </activity>
Play action
Human data
Data category categories for attachments
It's okay, soy sauce.
2.intent.setaction ("Com.itheima.intent2.open2")//action (HIT)
3.intent.addcategory (Intent.category_default);//additional information, usually intent.category_default (in case of Nothing)
4.//URL: Uniform Resource Locator HTTP HTTPS FTP Rtsp:uri: Uniform Resource Identifier URL is a subset of URIs
Intent.setdata (Uri.parse ("Jianren: Zhang San"));
Intent.settype ("Application/person");
Intent.setdataandtype (Uri.parse ("Jianren: Zhang San"), "Application/person"); //data (soy sauce)
StartActivity (intent);//This method executes, clears the data for Settype () and therefore uses Setdataandtype
Implicit Intent Intent