I am working on to avoid cut/copy/paste in smart phone (for tablet its fine). Its fine in port mode but coming in land mode EditText shows a Button Next. after selecting the text, next button converts into Edit Button which has copy,cut and paste option.
So is there any way to disable cut/copy after rotation when edit button appears.
i am following this link. How to disable copy/paste from/to EditText
I am able to disable copy-and-paste functionality with the following: textField. setCustomSelectionActionModeCallback(new ActionMode.
There's button on the bottom left corner of the keyboard from where you can swipe to a/x/c/v to select all/cut/copy/paste respectively.
Tap and hold in the space where you'd like to paste the text. Tap Paste in the menu that appears. You can alternatively choose to "Paste as plain text."
I think you can use this:
http://developer.android.com/reference/android/widget/TextView.html#attr_android:imeOptions
With the flag:
flagNoAccessoryAction
Used in conjunction with a custom action, this indicates that the action should not be available as an accessory button when the input method is full-screen. Note that by setting this flag, there can be cases where the action is simply never available to the user. Setting this generally means that you think showing text being edited is more important than the action you have supplied. Corresponds to IME_FLAG_NO_ACCESSORY_ACTION.
I would insist you to disable the long click on the EditText as that Edit
button appears when you long press on the selected text in the EditText.
et_text.setLongClickable(false);
Also, you can clear the ClipboardManager
, so that if you already have something that is already copied to ClipBoard will be cleared using,
ClipboardManager manager = (ClipboardManager)
getSystemService(Context.CLIPBOARD_SERVICE);
manager.setText("");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With