Android Webview ERR_UNKNOWN_URL_SCHEME Error

后端 未结 2 596
广开言路
广开言路 2021-01-18 22:49

When I click a link which goes to mailto:admin@ikiyuzoniki.net I get this error:

net: ERR_UNKNOWN_URL_SCHEME

I tried to add an <

2条回答
  •  悲&欢浪女
    2021-01-18 23:32

    try this

    if(url.startsWith("mailto:")){
            MailTo mt = MailTo.parse(url);
            Intent i = new Intent(Intent.ACTION_SEND);
            i.setType("text/plain");
            i.putExtra(Intent.EXTRA_EMAIL, new String[]{mt.getTo()});
            i.putExtra(Intent.EXTRA_SUBJECT, mt.getSubject());
            i.putExtra(Intent.EXTRA_CC, mt.getCc());
            i.putExtra(Intent.EXTRA_TEXT, mt.getBody());
            mContext.startActivity(i);
            view.reload();
            return true;
        } 
    

提交回复
热议问题