Search code examples
androidandroid-webviewdeep-linking

How to do -On Button click of a webview which is inside android app , a specific app screen opens?


I have some webview in my android app. So on click of a button inside webview, need to open a specific app screen using deeplink. How to do that?


Solution

  • create some custom JS interface and handle this click, how to HERE

    another aproach would be to use custom WebViewClient set for WebView with overriden shouldOverrideUrlLoading method and inside of it apply your own logic for opening some other Activity or whatever, and then return true. if passed url should be loaded in WebView just return false