-
Notifications
You must be signed in to change notification settings - Fork 352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setCurrentItem on viewPager not working #58
Comments
Change: pager.setCurrentItem(1); For: pager.post(new Runnable() {
@Override
public void run() {
pager.setCurrentItem(1);
}
}); But this just work until you start rotating the device because then It get lost.... When changing the default tab, there are still problems keeping the offset values so you may notice 'snapping' or wrong position on rotation. I will try to spend some time on it when possible. Because it has been a problem for a while and I probably didn't spend enough time looking for a proper solution. I leave the issue open and It will be the first issue to fix for next release. |
Ok, that works, but is a bit rare... |
Yes I know. I want that fixed. If you find the solution PR are welcome. Otherwise I will try to fix it when I have a moment to study the problem in depth |
I have seen that if you don't remove the |
Is there any way to not snapping? |
When I create my view, I want that viewPager move to some pager (eg pager number 1).
ViewPager move to that pager and PSTS update the states of every tab, but doesn't move the scroll to the correct position.
I have changed your example to be like mine and it doesn't work.
The changes that I have done are the following:
MainActivity.java:
activity_main.xml:
The text was updated successfully, but these errors were encountered: