0

I want slider in my imageview but it gives me only one image at a time if any one of you have a solution please tell me.

here in my activity class.

images come from the API and there is a whole path of every image and its a web url

  ArrayList<String>  imagepath1 = i.getExtras().getStringArrayList("event_photo");
for (int i1 = 0; i1 < imagepath1.size(); i1++) {
        stockArr = new String[imagepath1.size()];
        stockArr = imagepath1.toArray(stockArr);
    //  imagepath = stockArr.toString();
        String imagepath = stockArr[i1];

    }
if (!TextUtils.isEmpty(imagepath)) {
        if (imagepath.endsWith(".jpeg") || imagepath.endsWith(".jpg")
                || imagepath.endsWith(".gif") || imagepath.endsWith(".png")) {
            imageLoader = new ImageLoader(mcontext);

            mUpdateResults = new Runnable() {
                public void run() {
                    Animation rotateimage = AnimationUtils.loadAnimation(
                            getApplicationContext(), R.anim.alpha);

                    for (int i2 = 0; i2 < stockArr.length; i2++) {
                        imageLoader.DisplayImage(imagepath1.get(i2),
                                imagetop);

                    //  imagetop.startAnimation(rotateimage);
                        /*imagetop.setImageResource(number[currentimageindex
                                % stockArr.length]);*/

                    }

                }
            };
            final Handler mHandler = new Handler();
            int delay = 500; // delay for 1 sec.
            int period = 5000; // repeat every 4 sec.
            Timer timer = new Timer();
            timer.scheduleAtFixedRate(new TimerTask() {
                public void run() {
                    mHandler.post(mUpdateResults);
                }
            }, delay, period);



        } else {

        }
    }

Please Help if any one have a solution

Mansi Bhatt
  • 214
  • 3
  • 12

0 Answers0