I have EditText which I want to disable and enable onLongClick, but I'm unable to long click on them after they are disabled. What do do?
This was the code I wrote for the purpose:
for (int j = 0; j < noOfDigits; j++) {
        final int k = j;
        etReference[j].setOnLongClickListener(new View.OnLongClickListener() {
            @Override
            public boolean onLongClick(View view) {
                if(etReference[k].isEnabled()) {
                    etReference[k].setEnabled(false);
                }
                else if(!etReference[k].isEnabled()){
                    etReference[k].setEnabled(true);
                }
                return false;
            }
        });
}
 
     
    