If multiple activity has the same intent action, what happens when starting with the same action?
How do I specify an activity to start?
In cases where multiple activity has the same intent action, if you want to start a specified activity, the <intent-filter>
Add <data android:scheme= "app"/>. Also, write the code that starts as:
StartActivity (New Intent ("Com.w.learnintent.intent.action.myaty", Uri.parse ("app://myaty1"));
second, how to
initiate local activity via a browser link?
1. Create a new activity in the new project Launchlocalapp and configure it in the Androidmanifest.xml file:
<activity android:name= ". Localappaty ">
<intent-filter>
<category android:name= "Android.intent.category.BROWSABLE"/> <!--available--
<category android:name= "Android.intent.category.DEFAULT"/>
<action android:name= "Android.intent.action.VIEW"/>
<data android:scheme= "App"/> <!--agreement name--
</intent-filter>
</activity>
install it on the emulator.
2. Write the index.html page (webstorm) and execute:
<a href= "App://localapp" >launch My app</a> <!--Localapp is any parameter--
3. Access the 10.0.2.2:63343/webstormprojects/index.html through the browser in the simulator, click the link to access the activity
(localhost is accessed via the simulator and its address is 10.0.2.2).
Additional
When using Webstorm, pop-up requested without authorization,you can copy URL and open it in browser to trust it issues.
Solution:
File->settings->build,execution,deployment->debugger, select the option on the Allow unsigned requests, and apply it. )
Third, how can I receive the parameters passed over?
Localappaty.java:
Uri uri = getintent (). GetData ();
System.out.println (URI);
Run the program with console output:
I/system.out:app://localapp
Concept and application of intent in Android (ii)--intent filter related options