There is a WebView in my android app. It loads a webpage and user may click links to launch other apps by url scheme. Now I need to avoid this action.
For example, when user click a correct deeplink or applink in WeChat, WeChat will just say something like "sorry we can not launch xxx..." in its WebView, and user can open that page in browser to jump to the target app. I want to do the same thing.
I have seen this similar question how-can-i-disable-deeplinks in SO but there is no useful answer. And I have also tried to do something in shouldOverrideUrlLoading
or shouldInterceptRequest
but neither works. That means I can recognize the special url in shouldOverrideUrlLoading
, but override its return to true or false can not stop launching app because the deeplink action is not an override in WebView.