Skip to content
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

Is there ant way to update image array? #30

Closed
bachras opened this issue Nov 12, 2018 · 1 comment
Closed

Is there ant way to update image array? #30

bachras opened this issue Nov 12, 2018 · 1 comment
Labels

Comments

@bachras
Copy link

bachras commented Nov 12, 2018

Hi,
Thanks for great plugin. I have a scenario, where I don't want to check for all images on page load, but once user reach the end of the image array, I want to update array with another 20 images. Currently it shows error below, once I update the array of images. Any help is appreciated. Thanks


System.err: java.lang.IllegalStateException: The application's PagerAdapter changed the adapter's contents without calling PagerAdapter#notifyDataSetChanged! Expected adapter item count: 30, found: 40 Pager id: a Pager class: class com.tns.gen.android.support.v4.view.ViewPager_swipe_110_28_StateViewPager Problematic adapter: class com.tns.gen.android.support.v4.view.PagerAdapter_swipe_128_28_ImageSwipePageAdapter
System.err: 	at android.support.v4.view.ViewPager.populate(ViewPager.java:1137)
System.err: 	at android.support.v4.view.ViewPager.populate(ViewPager.java:1086)
System.err: 	at android.support.v4.view.ViewPager$3.run(ViewPager.java:267)
System.err: 	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911)
System.err: 	at android.view.Choreographer.doCallbacks(Choreographer.java:723)
System.err: 	at android.view.Choreographer.doFrame(Choreographer.java:655)
System.err: 	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
System.err: 	at android.os.Handler.handleCallback(Handler.java:789)
System.err: 	at android.os.Handler.dispatchMessage(Handler.java:98)
System.err: 	at android.os.Looper.loop(Looper.java:164)
System.err: 	at android.app.ActivityThread.main(ActivityThread.java:6541)
System.err: 	at java.lang.reflect.Method.invoke(Native Method)
System.err: 	at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)

````
@PeterStaev
Copy link
Owner

Hey @bachras , new version (4.1) should resolve this. Note that you need to push your images on the fore-last item and not the last one, since the plugin automatically preloads the next image from the current one to have a nice smooth scrolling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants