Created
November 3, 2015 04:49
-
-
Save shihabmi7/5325ae35a57e21075f59 to your computer and use it in GitHub Desktop.
Image Slider
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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