Just create a class in some of your package, create a layout file for that and add it to mainfest under application tag with tag and you can get the Splash type functionality in following way:
public class SplashActivity extends AppCompatActivity {
private static final long SPLASH_SCREEN_DELAY = 2000;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
CountDownTimer countDownTimer = new CountDownTimer(SPLASH_SCREEN_DELAY, 1000) {
@Override
public void onTick(long l) {
}
@Override
public void onFinish() {
User user = GeneralUtils.getRegisteredUser(SplashActivity.this);
if (user == null || user.getUserId() == null) {
Intent intent = new Intent(SplashActivity.this, WalkThroughActivity.class);
startActivity(intent);
} else {
Intent intent = new Intent(SplashActivity.this, MainActivity.class);
startActivity(intent);
}
SplashActivity.this.finish();
}
};
countDownTimer.start();
}
}