dimanche 24 mai 2015

How can I get intent url in android webview?

I try to link an intent url like this,

private class myWebViewClient extends WebViewClient {
    @Override
    public boolean shouldOverrideUrlLoading(WebView view, String url) {

        if (url.contains("tel:")) {
            startActivity(new Intent(Intent.ACTION_CALL, Uri.parse(url)));
            return true;
        }

        else if (url.contains("mailto:")) {
            startActivity(new Intent(Intent.ACTION_SENDTO, Uri.parse(url)));
            return true;
        }

        else if(url.contains("intent:")){
            startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
            return true;
        }else {
            view.loadUrl(url);
            return true;
        }
    }

but error occurred like this.

START u0 {act=android.intent.action.VIEW dat=intent://mvaccine?siteid=shinhancard&licensekey=dece108e71f631bbdb2cefeea7517d207637d1bc&version=1.5&show_update=true&update_pattern=true&update_engine=true&scan_rooting=true&scan_package=true&scan_heuristic=false&target_type=false&show_license=true&show_rooting=true&isFgOrBg=true&useBlackAppCheck=true&rootingexitapp=true&rootingyesorno=false&rootingyes=false&showAbout=false&callback_url=http://ift.tt/1F1eq42} from uid 10215 on display 0

05-22 14:23:53.475 16677-16677/? W/System.err﹕ android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=intent://mvaccine?siteid=shinhancard&licensekey=dece108e71f631bbdb2cefeea7517d207637d1bc&version=1.5&show_update=true&update_pattern=true&update_engine=true&scan_rooting=true&scan_package=true&scan_heuristic=false&target_type=false&show_license=true&show_rooting=true&isFgOrBg=true&useBlackAppCheck=true&rootingexitapp=true&rootingyesorno=false&rootingyes=false&showAbout=false&callback_url=http://ift.tt/1F1eq42 }

how can I use and display Intent:// url in app?

I think url execute an app but webview and intent doesn't work

Aucun commentaire:

Enregistrer un commentaire