I think this is possible with TimerTask and Timer. try this code. I think this will help you.
private Handler mHandler; private Runnable mUpdateResults; private Timer timerAnimate; private TimerTask timerTask; mHandler = new Handler(); mUpdateResults = new Runnable() { public void run() { AnimateandSlideShow(); } }; int delay = 0; int period = 15000; timerAnimate = new Timer(); timerTask = new TimerTask() { public void run() { mHandler.post(mUpdateResults); } }; timerAnimate.scheduleAtFixedRate(timerTask, delay, period); Public void AnimateandSlideShow() { imageSwitcher.setImageResource(imageList[curIndex]);
source share