protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final View view = View.inflate(this, R.layout.activity_splash, null);
setContentView(view);
AlphaAnimation alphaAnimation = new AlphaAnimation(0.5f ,1f);
alphaAnimation.setDuration(3000);
alphaAnimation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {}
@Override
public void onAnimationEnd(Animation animation) { redirectToMainFrame(); }
@Override
public void onAnimationRepeat(Animation animation) { }
});
view.startAnimation(alphaAnimation);
}
protected void redirectToMainFrame()
{
Intent intent = new Intent(this, MainActivity.class);
startActivity(intent);
finish();
}