4

At first my EditText had the focus as soon as the app loaded the screen and I disabled that with

android:focusable="true" 
android:focusableInTouchMode="true"

However, there is no way to lose focus after clicking the EditText. The focus is still there when I try to click outside of the text area. This also happens when I click on the EditText to change the value and press "Done" on the on screen keyboard. Does anyone know a way for me to accomplish this?

Sunandmoon
  • 297
  • 2
  • 4
  • 9
  • what do you want to accomplish by removing the focus from edittext field. – mudit Mar 17 '11 at 06:15
  • you are setting it to be be focused only when you are giving android:focusable="true" android:focusableInTouchMode="true". Otherwise set it as false and see. – Anju Mar 17 '11 at 08:57

1 Answers1

3

Focus only changes if you click on something else that can gain focus. Issue is: If you click on a button for instance you might not lose focus, unless you do what Mathew said. Problem with that is: A button whose focusableInTouchMode is set to "true", needs now to be clicked TWICE: Once for gaining focus and once for performing OnClick. A nagging issue, that was haunting me as well right now.

Community
  • 1
  • 1
AgentKnopf
  • 4,295
  • 7
  • 45
  • 81