We already know that <intent-filter> is used to define how your activity is opened by another activity, which is called a "filter". But if there are two activity with the same <intent-filter>, what will happen?
Code in the Androidmanifest.xml.
<?xml version= "1.0" encoding= "Utf-8"?> <manifest xmlns:android= "http://schemas.android.com/apk/res/"
Android "package=" Net.horsttnann.UsingIntent "android:versioncode=" 1 "android:versionname=" 1.0 "> <uses-sdk android:minsdkversion= "/> <application android:icon=" @drawabl E/ic_launcher "android:label=" @string/app_name "> <activity android:label=" @str Ing/app_name "Android:name=". Usingintentactivity "> <intent-filter > <action android:name=" android.inte
Nt.action.MAIN "/> <category android:name=" Android.intent.category.LAUNCHER "/>" </intent-filter> </activity> <activity android:label= "Se Cond activity "Android:name=".
Secondactivity "> <intent-filter > <action android:name= "net.horsttnann.SecondActivity"/> <category android:name= "and
Roid.intent.category.DEFAULT "/> </intent-filter> </activity> <activity android:label= "third activity" android:name= ". Thirdactivity "> <intent-filter > <action android:name=" Net.horsttnann.Sec Ondactivity "/> <category android:name= Android.intent.category.DEFAULT"/> & lt;/intent-filter> </activity> </application> </mani Fest>
If you use the StartActivity () method to start an activity, the Android system will pop up a window that selects activity.