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

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -