-1

I have a editView with OnClick event to show Calender like this :

 <EditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/checkOut"
            android:onClick="onPlayButton"
            android:inputType="date"
            />

I want to disable typing in this EditView in order user just could select date from my calender.

Sathish Kumar J
  • 4,280
  • 1
  • 20
  • 48
samira riazati
  • 515
  • 7
  • 21

4 Answers4

1

Set android:focusable="false" in your EditText tag

SripadRaj
  • 1,687
  • 2
  • 22
  • 33
0

To disable an edit view progrmatically use

editView.setEnabled(false);
Malith Lakshan
  • 762
  • 6
  • 12
0

Try this.

By Java

editText.setEnabled(false);

By xml

android:editable="false"

or if you want to show the edittext but not input any values

edittext.setInputType(0);
Sathish Kumar J
  • 4,280
  • 1
  • 20
  • 48
0

You should use some thing like this

<EditText
    ...
    android:editable="false"
    android:inputType="none" />
MRX
  • 1,400
  • 3
  • 12
  • 32