0

I don't understand why this is happening. I set imageview so that it is invisible. Then rotate it. However I can see the imageview flicker on and off the screen. How come setvisibility isn't working immediately?

img = (ImageView) findViewById(R.id.mystuff);
            img.setVisibility(View.INVISIBLE);

            animation = new RotateAnimation(0, 0,
                    Animation.RELATIVE_TO_SELF, 0.5f,
                    Animation.RELATIVE_TO_SELF, 0.5f);


            animation.setDuration(0);
            img.startAnimation(animation);
Jake
  • 2,877
  • 8
  • 43
  • 62

1 Answers1

0

when you rotate the device, the view is recreated. so the onCreate is called again and your img is recreated. Maybe that's your problem. Otherwise show where this code stands in.

Diogo Bento
  • 197
  • 2
  • 13