I guess this is pretty simple question but somehow I cannot figure it out.
I am animating couple of .png file from drawable folder, it is working fine as they are animated and stopped as required. What I am trying from previous three hours is that I want to hide the imageview once the animation is stopped. This is the simple code i am using
animImageView = (ImageView) findViewById(R.id.iv_animation);
animImageView.setBackgroundResource(R.drawable.anim);
animImageView.post(new Runnable() {
@Override
public void run() {
visiblity = false;
frameAnimation =
(AnimationDrawable) animImageView.getBackground();
frameAnimation.start();
frameAnimation.setOneShot(true);
//animImageView.setVisibility(View.INVISIBLE);
}
});
Even tried the removeCallBack() methods on imageview but its not working. Can somebody please guide me what I am doing wrong or what I need to do to overcome this.
Thanks.