android: textIsSelectable in WebView

0

I'm creating an app, and I wanted to leave hide the option to select the text and copy.

You know when we focus over the text and that option appears to copy or share the text, I wanted to remove it.

WebView;

<WebView
    android:id="@+id/webView_des"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_marginTop="5dp"
    />

Code that takes body as string ;

String mimeType = "text/html; charset=UTF-8";
            String encoding = "utf-8";
            String htmlText = allArrayNewsDes[position];

            String text = "<html><head>"
                    + "<style type=\"text/css\">body{color: #525252;}"
                    + "</style></head>"
                    + "<body>"                          
                    +  htmlText
                    + "</body></html>";

            webnewsdes.loadData(text, mimeType, encoding);

I have tried everything but to no avail.

Type this here, I want to remove it from WebView;

    
asked by anonymous 11.02.2018 / 01:02

1 answer

0

Add an OnLongClickListener to WebView and make the method onLongClick() return true .

webnewsdes.setOnLongClickListener(new View.OnLongClickListener() {
    @Override
    public boolean onLongClick(View v) {
        return true;
    }
});
    
11.02.2018 / 16:18