Skip to content

Instantly share code, notes, and snippets.

@shihabmi7
Created November 3, 2015 04:49
Show Gist options
  • Save shihabmi7/5325ae35a57e21075f59 to your computer and use it in GitHub Desktop.
Save shihabmi7/5325ae35a57e21075f59 to your computer and use it in GitHub Desktop.
Image Slider
public void imageSlider() {
final Handler mHandler = new Handler();
// Create runnable for posting
final Runnable mUpdateResults = new Runnable() {
public void run() {
AnimateandSlideShow();
}
};
Timer timer = new Timer();
timer.scheduleAtFixedRate(new TimerTask() {
public void run() {
mHandler.post(mUpdateResults);
}
}, delay, period);
}
private void AnimateandSlideShow() {
slidingimage = (ImageView) findViewById(R.id.imageView__slide_header);
slidingimage.setImageResource(IMAGE_IDS[currentimageindex
% IMAGE_IDS.length]);
currentimageindex++;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment