How about a super-flexible launch screen that can use the same code and is defined in the AndroidManifest.xml, so the code will never need to change. I generally develop libraries of code and do not like customizing code because it is sloppy.
Then the SpashActivity itself looks up the meta-data for "launch_class" to then make the Intent itself. The meta data "duration" defines how long the splash screen stays up.
public class SplashActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.activity_splash);
ComponentName componentName = new ComponentName(this, this.getClass());
try {
Bundle bundle = null;
bundle = getPackageManager().getActivityInfo(componentName, PackageManager.GET_META_DATA).metaData;
String launch_class = bundle.getString("launch_class");
//default of 2 seconds, otherwise defined in manifest
int duration = bundle.getInt("duration", 2000);
if(launch_class != null) {
try {
final Class> c = Class.forName(launch_class);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
Intent intent = new Intent(SplashActivity.this, c);
startActivity(intent);
finish();
}
}, duration);
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}
}
}