I have 3 tabs in ViewPager. The focus in Tab 2 is by default in the first EditText. When I move from Tab 2 to Tab 3 and back, I find that the focus is in the last EditText of tab 2. If I go to Tab 1 and back, the focus will return to the first EditText. Therefore, it seems that when I move "to the right", the focus goes to the last EditText fragment that I was in. I do not want it. I want the focus to be either where I left it, or where it is by default.
In addition, I do not want to just return focus back to the first EditText after returning, because it goes to the last EditText, first of all, scrolls my page down. I want it to move with focus back to my EditText.
Is there a way to prevent the focus from moving to the last EditText in Tab 2 when scrolling to Tab 3?
source share