I am trying to figure out how to start an app from a URL, and how I should write that URL.
I have the following code in my AndroidManifest:
You need to have two <intent-filter>
elements for this <activity>
. One will be for MAIN
and LAUNCHER
. The other will be for VIEW
, BROWSABLE
/DEFAULT
, and your <data>
element:
<activity android:name=".MyActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"></action>
<category android:name="android.intent.category.LAUNCHER"></category>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"></action>
<category android:name="android.intent.category.DEFAULT"></category>
<category android:name="android.intent.category.BROWSABLE"></category>
<data android:host="my.app" android:scheme="http"></data>
</intent-filter>
</activity>
Then, http://my.app
should launch your activity.