Deep Chhowala
Deep Chhowala

Reputation: 109

Change image of imageview for 5 seconds and then restore original

I have set image's on 4 imageview's in XML file, now on button click I want to change images of all 4 imageview's. And after 5 seconds of button click, all the images should change to original images.

Upvotes: 0

Views: 155

Answers (1)

A. Wahab
A. Wahab

Reputation: 120

You can do this by using the thread like:

OnClick(View view){
  //change  the images of all images view  
    new Handler().postDelayed(new Runnable() {
       @Override
        public void run() {
           //change  the images for all images view to previous ones 
          }
    }, 5000);

  }

Upvotes: 2

Related Questions