• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Refocus on a lost focuschanged view

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?
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones