views:

18

answers:

1

Hello friends, I want put delay between two flips of the same image on ImageView. i.e. (1). Image loads with Animation (2). Wait for 1 or 1.5 seconds (3). Image changes with animation on the same ImageView.

I tried to set Thread.Sleep() , didn't work.

And yes, these all things I want to be done on android.

A: 

You can look at TimerTask. So, you set the time interval before it invokes the event of animation.

timer = new Timer() ;
task = new TimerTask() {
@Override
public void run() {
   // some code here..
    }
};
timer.scheduleAtFixedRate(task, 5000, 1000 ) ;

Hope this sample helps you..

Vinay
I also tried tht.But Not working still..
Hrushikesh
I just want to change image to new one, and after some time original image should be loaded on the same imagebutton. with animation .
Hrushikesh
can you post your code here..?Will try to look at it..
Vinay