I want to add fadeout animation for my splash screen, that is while closing the splash screen I want to bring the fadeout animation effect.
Here are the codes which I ha
If you're using a separate Activity for your splash screen, you can do the overridePendingTransition call that you've noted is available in Android 2+ only. You can choose to have apps that are built for 2+ do the transition and previous versions simply do the default transition:
try {
Method method = Activity.class.getMethod("overridePendingTransition", new Class[]{int.class, int.class});
method.invoke(youractivity, inanimation, outanimation);
} catch (Exception e) {
// Can't change animation, so do nothing
}
It's better to have your splash screen a part of your main Activity (see this example). When the splash screen is part of your main activity, you can simply assign the animation to the splash screen layout.