AndroidImageSlider icon indicating copy to clipboard operation
AndroidImageSlider copied to clipboard

.setCuurentPosition hangs when traversing backwards

Open nitin84india opened this issue 11 years ago • 14 comments

Hi, I found an issue when using setCurrentPosition method while traversing backwards. Suppose I am at slide no 1 and called .setCurrentPosition method to set current slide index to 5, it will work, but if I call .setCurrentPosition from 5th index to say 3rd then the application hangs. I'm getting the following error in doing so: E/dalvikvm﹕ Fatal spin-on-suspend, dumping threads

nitin84india avatar Dec 28 '14 20:12 nitin84india

How many images totally?

daimajia avatar Dec 29 '14 00:12 daimajia

12

nitin84india avatar Dec 29 '14 02:12 nitin84india

Yes nitin is right. It hangs on backward selection.

kailash09dabhi avatar Feb 11 '15 19:02 kailash09dabhi

+1 This also indirectly causes nifty ANR states when switching between screens with Image Sliders and trying to set initial position to 0 while switching on their start. I have 5 images in the slider.

muratogat avatar Mar 10 '15 22:03 muratogat

Same problem here

delchiaro avatar May 03 '15 17:05 delchiaro

This issue is still there. Any fixes?

praveenspark avatar Jun 25 '15 12:06 praveenspark

I am also facing this issue. Any solution for this?

anshulagarwal06 avatar Feb 03 '16 06:02 anshulagarwal06

I am also facing tooo. Can anybody help me?

oalpayli avatar Jun 20 '16 11:06 oalpayli

i have this issue too.

samira-badamestani avatar Jun 21 '16 06:06 samira-badamestani

same problem :/

darwin2k avatar Jun 23 '16 13:06 darwin2k

this seems to be working for me: Set the slider to last position and then call moveNextPosition() because of the infinite loop.

 profileSlider.setCurrentPosition(arrayLength, false);
 profileSlider.moveNextPosition();

darwin2k avatar Jun 23 '16 13:06 darwin2k

This work for me, thanks @darwin2k

  if (sliderLayout.getCurrentPosition() > position) {
                    sliderLayout.setCurrentPosition( array.size() - 1, false);
                    sliderLayout.moveNextPosition();
                }
                sliderLayout.setCurrentPosition(position, false);

ubione88 avatar Mar 21 '18 02:03 ubione88

if (sliderLayout.getCurrentPosition() > position) { sliderLayout.setCurrentPosition( array.size() - 1, false); sliderLayout.moveNextPosition(); } sliderLayout.setCurrentPosition(position, false);

not working for me.

zia-limemedia avatar Jul 05 '18 13:07 zia-limemedia

This work for me, thanks @darwin2k

  if (sliderLayout.getCurrentPosition() > position) {
                    sliderLayout.setCurrentPosition( array.size() - 1, false);
                    sliderLayout.moveNextPosition();
                }
                sliderLayout.setCurrentPosition(position, false);

This doesn't freeze the app at least. But it doesn't load the images. I changed the smooth loading to true, and it started loading them.

paakjis avatar Feb 26 '19 09:02 paakjis