如何打印内部的WebView Android中选定的文本

问题描述:

我想在Android的应用程序中的的WebView 内选定的文本。打印此文.. 怎么样 ?你的帮助是非常AP preciated。

I want to get the selected text inside a webview in android application. and print this text .. how ? your help is highly appreciated.

我的意思是,在的WebView 文本高亮显示。

I mean the text highlighted in the webview.

它可以帮助你。

  webview.setWebViewClient(new WebViewClient()
  {
    @Override
    public boolean shouldOverrideUrlLoading(WebView view, String url)
    {
        // progressBar.show();
        // view.loadUrl(url);

        if (url.startsWith("mailto:") || url.startsWith("tel:")) 
        {

                    int len = url.length();
                    char[] desArray = new char[len - 7];
                    url.getChars(7, len, desArray, 0);
                    String newString1 = new String(desArray);
                    newString1.trim();
                    Log.d("Str", newString1 + "");
                    sendGmail(newString1, 1);
                    return true;
        }
        else 
        {
                    return super.shouldOverrideUrlLoading(view, url);
        }
    }

这code是获取从web视图的电子邮件地址并获取电话号码。

This code is for getting the email Address from webview and getting the phone numbers.