1. manifest file
1 <Activity2 Android:name= "Com.example.twoactivity.OtherScreenActivity"3 Android:label= "@string/app_name" >4 <Intent-filter>5 <ActionAndroid:name= "Com.itheima.com" />//Set action name6 <categoryAndroid:name= "Android.intent.category.DEFAULT" />//Set additional information to provide some environment parameters for execution. I have a question about that. Name does not correspond7 </Intent-filter>8 </Activity>
2. Open the Activity Code
1 New Intent (); 2 intent.setaction ("com.itheima.com"); 3 intent.addcategory ("Android.intent.category.DEFAULT"); 4 startactivity (intent);
3. Acquire the intention to activate it
1 Intent Intent = Getintent (); // Gets the intent to activate it 2 uri uri = Intent.getdata (); // gets the data passed to it. 3 String result = uri.tostring (); 4 System.out.println (result);
Note: If the <data android:scheme= "Itheima" ></DATA> is configured in the manifest file, then the intent must be activated with Intent.setdata (Uri.parse ("Itheima: xxx ")); Such a setting, otherwise error.
If the manifest file is configured as <data android:scheme= "Itheima" android:mimetype= "Vns.android.cursor.item/haha" ></data> The activation intent must have Intent.setdataandtype (Uri.parse ("Itheima:gogogo"), "Vns.android.cursor.item/haha") or an error.
Scheme is the meaning of the specification of the data, and MimeType is the type of the description data
Custom implicit Intent