android - Image View change image after paticular time interval -


i using image view , want change image @ particular interval.

i have 10 images.

how this?

you need timertask it.

below snippet you

it change image every 3 seconds.

  timer = new timer();             timer.schedule(new timertask() {                  @override                 public void run() {                     runonuithread(new runnable() {                          public void run() {                              if (flag > 1) {                                 timer.cancel();                                 timer = null;                             } else                                 imageview.setimageresource(images[flag++]);                          }                     });                  }             }, system.currenttimemillis(), 3000); 

Comments

Popular posts from this blog

How do you change vbulletin's home page to the forums instead of the default (CMS or Activity Stream)? -

c++ - Troubles when compiling phash program -