How to blink image in ImageView (Android)
**Try this code **
image = (ImageView) findViewById(R.id.image);
Animation animation = new AlphaAnimation((float) 0.5, 0); // Change alpha from fully visible to invisible
animation.setDuration(500); // duration - half a second
animation.setInterpolator(new LinearInterpolator()); // do not alter
// animation
// rate
animation.setRepeatCount(Animation.INFINITE); // Repeat animation
// infinitely
animation.setRepeatMode(Animation.REVERSE); // Reverse animation at the
// end so the button will
// fade back in
image.startAnimation(animation);
The following code snippet will blink the ImageView . Set the background of ImageView as Transparent.
Animation animation = new AlphaAnimation(1, 0); //to change visibility from visible to invisible
animation.setDuration(1000); //1 second duration for each animation cycle
animation.setInterpolator(new LinearInterpolator());
animation.setRepeatCount(Animation.INFINITE); //repeating indefinitely
animation.setRepeatMode(Animation.REVERSE); //animation will start from end point once ended.
imageButton.startAnimation(animation); //to start animation