I have a requirement in Android. I have a button. And i want to render 5 images one after another as the background resource of the button with a time difference.
It is like when the rendering starts, the first image will be shown. After few miliseconds, the second image will be shown and will continue until the 5th one is shown.
I think it is achievable with handler. But quite not sure how. Can someone please help
Use a CountDownTimer:
//25 second, 5 second per image
new CountDownTimer(25000, 5000) {
public void onTick(long millisUntilFinished) {
//Set your image
}
public void onFinish() {
//Done!
}
}.start();
See here for more advice CoundDownTimer
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With