0
votes

by default, WebView opens all types of links to load in the WebView

How to open/load all URL in the WebView EXCEPT any URL hosted by WhatsApp? I want this to be loaded by user's Default Browser

I know i should be extending WebViewClient and implementing shouldOverrideUrlLoading . But not sure how. How does it look like inside MyAppWebViewClient.java, if i create one for such tasks?

1
ould you provide in your question the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example."Artem
your problem isn't clear enough, if you mean the type of links to open whatsapp app from other apps or websites, you should use their URL formatting which is https://wa.me/<number>bbadawee
I know the link. I just want that link to load in a browser or my WhatsApp app instead of load in the WebViewFadhli Mohamad
Question edited. Thank YouFadhli Mohamad

1 Answers

0
votes

You can use WhatsApp api to make your Android webview app open WhatsApp This is an example to send a message through WhatsApp by calling the api

https://api.whatsapp.com/send?phone=phone-number

Hope this helps. Good luck!