intentfilter - Launch Android activity when click on href in Chrome browser -
i want open app's loginactivity when click on <a href="www.myhost.com"/>
in web in chrome browser app. have code not working:
<activity android:label="@string/app_name" android:launchmode="singletask" android:name=".activities.loginactivity" android:screenorientation="portrait" android:windowsoftinputmode="statevisible"> <intent-filter> <action android:name="android.intent.action.main"/> <category android:name="android.intent.category.launcher"/> </intent-filter> <intent-filter> <data android:scheme="http" android:host="myhost.com"/> <category android:name="android.intent.category.default"/> <category android:name="android.intent.category.browsable"/> <action android:name="android.intent.action.view"/> </intent-filter> </activity>
what doing wrong?
thanks.
you need set :
<intent-filter> <action android:name="android.intent.action.view" /> <category android:name="android.intent.category.default" /> <category android:name="android.intent.category.browsable" /> <data android:host="example.com" android:pathprefix="/someresource/" android:scheme="http" /> <data android:host="www.example.com" android:pathprefix="/someresource/" android:scheme="http" /> </intent-filter>
notice in case, need use android:pathprefix instead of android:path.
Comments
Post a Comment