Refocus on a lost focuschanged view

Last Updated:

  1. Leolicos

    Leolicos Well-Known Member This Topic's Starter

    Jun 16, 2010
    Likes Received:
    I have a few EditText views in my app. All the EditTexts are numbers. I have a focuschangedlistener on all of them and if a nonvalid number is entered once the focus is lost, in the focuschanged function with hasfocus == false, I want an alert to show, then the focus go back to that same EditText. The problem is at the .requestfocus(). It seems that once I lose focus and focus on another view, then focuschanged function is called which refocuses on the previous view but for some reason BOTH the newly focused view AND the previous view are both focused at the same time. Should I do this another approach instead of requesting focus in the focuschanged function?


Share This Page