Android: Prevent Clipboard Copy of Text?

Try this on TextViews, This mechanism is same in WebView as well.

Try this on TextViews, This mechanism is same in WebView as well. TextView.cancelLongPress(); webView.cancelLongPress(); This should work, as user will not be able to trigger onLongClickListner. Hope this will help to achieve in shortest possible code.

Happy Coding!

The copy/paste/select..etc dialog shows up when you do long press on the text area. What if you override onLongClickListener for your view and do nothing inside? Or use ClipboardManager and listen for primary clip changes, if the changes occur then check if there is text or anything else, if true then use setPrimaryClip() with ClipData instance that contains let say empty string.

This not might be the best approach, but these pointers maybe will give you the idea. developer.android.com/reference/android/... developer.android.com/reference/android/....

The below worked for me: textView. SetLongClickable(false).

For some reason none of the other answers worked for me so here is my take on it. I specifically used it on a Webview : webview. SetOnCreateContextMenuListener(new OnCreateContextMenuListener() { public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { menu.clear(); } }); Hope it helps someone.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions