0

I have an EditText that expands when user clicks on it using SetOnClick, but when the user presses back or finish edit the EditText, I want to resize the EditText. I try using SetOnFocusChanged but the event is not raised. Anyone has a suggestion?

Léon Pelletier
  • 2,628
  • 2
  • 37
  • 65
gilush14
  • 485
  • 1
  • 9
  • 20
  • When you use `onClickListener` on the next `EditText` field, inside the `onClick` method you can set the `layout width and height` of the previous `EditText` to `wrap content`. Well, this is the best I could come up with. – Ghost Feb 27 '12 at 08:18
  • This appears to be the same question as yours, no? http://stackoverflow.com/questions/5099814/knowing-when-edit-text-is-done-being-edited – Yevgeny Simkin Feb 27 '12 at 08:18
  • Ghost, onClickListener you know only when you click but not when you exit. Dr. Dredel it's not the same question because i don't want to know when edittext is done being edit i want to know when the edittext is not focus, e.g when user press the back button (not recognized as BackPressed() when you leave the edittext) – gilush14 Feb 27 '12 at 08:43
  • See http://developer.android.com/reference/android/text/TextWatcher.html – cs95 Jul 15 '19 at 05:24
  • please look at this link... http://developer.android.com/reference/android/text/TextWatcher.html – Jackson Chengalai Feb 27 '12 at 08:17
  • i'm already using TextWatcher to do somthing else but still you cannot recoginze focus in TextWatcher. meaning if user didn't press some key the textwatcher not recognize backbutton – gilush14 Feb 27 '12 at 08:44
  • i think this question is helpful.. http://stackoverflow.com/questions/5099814/knowing-when-edit-text-is-done-being-edited – Jackson Chengalai Feb 27 '12 at 09:06
  • as i told Dr.Dredel this question is not the same, but tnx – gilush14 Feb 27 '12 at 09:08
  • That's why I hate android development so much. Too much "little" inconveniences that makes you mad and your code ugly. – ooops Jun 16 '13 at 20:46

0 Answers0