0

i have a checkbox on whose de-selection i enable my edittext field (mEditText.setClickable(true) and mEditText.setEnabled(true) )

but, when these two fields are false i.e when the check box is selected--->>> when i click on my disabled Edittext field it shows a Virtual keyboard, though the edittext field is not edittable.

i want a fix to this problem

When i tried mEdittext.setfocusable(false) when checkbox deselected and setfocusable(true) when checkbox selected.... the field become non editable and the virtal keyboard also doesnot appear at all

Varun
  • 87
  • 1
  • 10

1 Answers1

0

This is what i getting form your question.

cb = check Box
Edit_Text = Edit Text

 if (!cb.isChecked())
        {
          Edit_Text.setEnabled(true);
          Edit_Text.setClickable(true);
        }
        else
        {
          Edit_Text.setEnabled(false);
          Edit_Text.setClickable(false);
        }

For Hide the KeyBoard you should refer this :

How to hide soft keyboard on android after clicking outside EditText?

Community
  • 1
  • 1
Chintan Khetiya
  • 15,962
  • 9
  • 47
  • 85
  • yeah this is current the scenario..how to force the virtual keyboard not to pop up when (!checked) – Varun Nov 05 '12 at 12:19