I have a looping animation I want to present for an image button before a static image is used; on each button press. Is there a way to run this animation for around 2000 milliseconds then switch over to the image. What I have tried just results in a pause then the static image.
button.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {
animationrun();
long time = System.currentTimeMillis();
time += 2000;
while(time > System.currentTimeMillis())
{}
select();
}
});
public void animationrun()
{
button.setBackgroundResource(R.drawable.ball_anim);
animation = (AnimationDrawable)button.getBackground();
animation.start();
}
public void select()
{
button.setBackgroundResource(R.solidImage);
}
SOLUTION: http://www.facebook.com/topic.php?uid=128857303793437&topic=74