Question

I have implemented the Jake Wharton's ViewPagerIndicator. Here, I am reloading the data when the orientation is changed.

In landscape I have 6 pages & I have scrolled to last page. The result is here here

Now, I have changed the orientation to portrait. Now portrait has only 4 pages. But, the result is here.

enter image description here

Here the indicator has gone out of the available items.

But, the selected page is 1.

How to resolve this issue? I have used the following line

circlePageIndicator.setCurrentItem(0);

Even then its not working?

Was it helpful?

Solution

You most likely have android:configChanges="orientation" in your manifest which is preventing the activity from restarting on orientation changes. Because of this, certain fundamental aspects of the view are changing (e.g., the width) and the control isn't updating properly since you prevent recreation.

OTHER TIPS

circlePageIndicator.setCurrentItem(0); selects page at position 1?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top