6

I'm building a settings screen using PreferenceFragment within PreferenceActivity. Everything works fine other than an annoying issue where the soft keyboard stays visible after an EditTextPreference dialog has been closed, either by tapping Cancel, OK or tapping outside the dialog.

This is the first app I've built using API level 15 (4.0.3). My previous app was for API level 8 (2.2) and just used PreferenceActivity for its settings (no fragment). In that app, the keyboard always closes automatically on tapping Cancel, OK or outside the dialog - no code required.

Is it now normal to have to code the closing of the keyboard after dismissing an EditTextPreference dialog? If so which event to I need to use to trap this?

Jonathan Wareham
  • 3,357
  • 7
  • 46
  • 82
  • you could set android:imeOptions="actionDone", once done is pressed it will automatically close the keyboard, I think keyboard should be closed when Edittext lose the focus – Yauraw Gadav Apr 16 '15 at 11:24
  • tapping the Done/Finished button on the keyboard just closes the keyboard and leaves the EditTextPreference dialog on screen. – Jonathan Wareham Apr 16 '15 at 11:33
  • check this out http://stackoverflow.com/questions/19217582/implicit-submit-after-hitting-done-on-the-keyboard-at-the-last-edittext – Yauraw Gadav Apr 16 '15 at 11:36
  • I have the same problem as the OP. It is very annoying. – Vicky Leong Jan 14 '16 at 20:58

0 Answers0