java - How to handle app links for a webview app -
i'm trying handle app links in webview app. means if user click on link example.com/example.html
app should show open dialogbox. i've implemented this:
<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:scheme="http" /> <data android:host="www.example.com" /> </intent-filter>
and mainactivity.java contains code:
public boolean shouldoverrideurlloading(webview view, string url) { ... ... if (uri.parse(url).gethost().contains("www.example.com")) { return false; } intent intent = new intent(intent.action_view, uri.parse(url)); view.getcontext().startactivity(intent); return true; } });
but problem when user open link using app, shows home screen rather clicked link/page.
how can implement this?
thanks.
Comments
Post a Comment