In my android application, I have a splash screen which blinks the logo of the app for 3 seconds and then start the login activity. Here is my code:
imgView.postDelayed(new Runnable() {
@Override
public void run() {
final Animation animation = new AlphaAnimation(1, 0);
animation.setDuration(1000);
animation.setInterpolator(new LinearInterpolator());
animation.setRepeatCount(Animation.INFINITE);
animation.setRepeatMode(Animation.REVERSE);
imgView.startAnimation(animation);
}
}, 3000);
Intent intent = new Intent(SplashscreenActivity.this,LoginActivity.class);
startActivity(intent);
But the image blinks infinitely. How to stop blinking after 3 seconds? I referred some posts but I could not get an exact answer.