I want to disable copy paste in all of my android page and no one cant long touch on my application .
android:longClickable="false"
it dosent work.
I want to disable copy paste in all of my android page and no one cant long touch on my application .
android:longClickable="false"
it dosent work.
This worked for me:
In xml, disable the long-click in the EditText:
android:longClickable="false".
Also, you have to return false from these methods:
mEditEext.setCustomSelectionActionModeCallback(new ActionMode.Callback() {
public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
return false;
}
public void onDestroyActionMode(ActionMode mode) {
}
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
return false;
}
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
return false;
}
});
I think it will work fine. User can not able to copy your page to another app.
//Inside onResume and onDestroy
ClipboardManager clipboardManager = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
clipboardManager.setText("");
Here, It will restrict for background process "Secondary app". But you can copy and paste it only inside your app.