7

I have to do a ListView that contains on each item an EditText. If the EditText receives focus, I have to display a dialog - the condition is strictly for when the EditText receives focus and not when is pressed because it can be selected even if it is not pressed...

To do this I use a focus listener on the EditText but the onFocusChanged gets called three times instead on only one when the user presses the EditText, this means the dialog gets called twice...

This is the sequence of the calls:

  • Has focus
  • Lost focus
  • Has focus

I don't have any other special handling of the ListView or EditText .. so it should be from the system somehow, maybe because I am using the EditText on the ListView which is a focusable View too..

Does anyone have any ideas why is this happening and how can I "fix" this?

Thank you in advance.

4

0 回答 0