0

Dears I have Webview app and I can't open any WhatsApp links or telephone I use the following code

@Override
    public void menuItemClicked(Action action, MenuItem item) {
        if (WebToAppWebClient.urlShouldOpenExternally(action.url)){
            //Load url outside WebView
            try {
                startActivity(
                        new Intent(Intent.ACTION_VIEW, Uri.parse(action.url)));
            } catch(ActivityNotFoundException e) {
                if (action.url.startsWith("intent://") || (action.url.startsWith("whatsapp:")
                || (action.url.startsWith("tel:")))){
                    startActivity(
                            new Intent(Intent.ACTION_VIEW, Uri.parse(action.url.replace("intent://", "http://"))));
                            new Intent(Intent.ACTION_VIEW, Uri.parse(action.url.replace("whatsapp:", "http://")));
                            new Intent(Intent.ACTION_VIEW, Uri.parse(action.url.replace("tel:", "http://")));
                } else {
                    Toast.makeText(this, getResources().getString(R.string.no_app_message), Toast.LENGTH_LONG).show();
                }
            }```
Rashed
  • 1

0 Answers0