delight-im / Android-AdvancedWebView

Enhanced WebView component for Android that works as intended out of the box
MIT License
2.39k stars 574 forks source link

whatsapp:// intent not working #266

Closed tsquaredesigns closed 4 years ago

viralvaghela commented 4 years ago

in the normal webview we can try this, but I have no idea about this AdvancedWebView

@Override public boolean shouldOverrideUrlLoading(WebView wv, String url) { if(url.startsWith("tel:") || url.startsWith("whatsapp:")) { Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse(url)); startActivity(intent); return true; } return false; }

ocram commented 4 years ago

Thanks!

Your solution, wrapped inside myWebView.setWebViewClient(new WebViewClient() { /* ... */ });, is indeed correct and also applicable with this library.