Home » Android » android – disable clipboard option Edittext-Exceptionshub

android – disable clipboard option Edittext-Exceptionshub

Posted by: admin February 26, 2020 Leave a comment

Questions:

I am struggling with removing PASTE option. Although i am able to remove PASTE option from menu while selecting text from edtittext but in some devices instead of Paste, Clipboard option is visible. Can anyone suggest any workaround ?

 @Override
    public int getSelectionStart() {
        for (StackTraceElement element : Thread.currentThread().getStackTrace()) {
             Log.e("TAG","====="+ element.getMethodName()+ "====");
            if (element.getMethodName().equals("canPaste") || element.equals("canSuggest")) {
                return -1;
            }
        }
        return super.getSelectionStart();
    }
How to&Answers: