in my application EditText is there which is disable and I want to implement long press option on this edittext(while disable mode) which enable it and allowing to enter the character from softkey.
Example:-
Suppose initially I am allowing user to enter some number into the EditText. After some operation, I need to disable this EditText. Again if user want to change the number which previously he enter in the editText then first he need to long press on this editText. After doing long press on this editText, editText get enable and again user will able to change or retype the number. I need to do some operation before changing the number in the editText and during operation user not have any option to change the number in the editText.
Code:-
<EditText
android:id="@+id/eTextBillNoFrmReturn"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginRight="2dp"
android:layout_weight="7"
android:clickable="true"
android:background="@drawable/custom_edit_text"
android:inputType="number" />
@Override
public boolean onLongClick(View v) {
// do some operation
return false;
}
but this code work only EditText is enable. Long press not work when EditText is disable.