how to launch an android app with custom url scheme -
i want launch app custom url scheme. checked deep links section on dev android , here snippet of code. doesnt seem fire though url looks : myapp://?host=myhost.com
manifest :
<intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> <category android:name="android.intent.category.browsable" /> <data android:scheme="myapp" /> </intent-filter>
in activity main activity, have :
intent intent = getintent(); uri uri = intent.getdata(); if (uri != null) { string host = uri.getqueryparameter("host"); }
the app not launch when have email has url hyperlink. also, way test ?
try this, edit intentfilter
<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="www.youtube.com" android:scheme="http"></data> </intent-filter>
edit
<intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </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="www.youtube.com" android:scheme="http"></data> </intent-filter>
Comments
Post a Comment