I'm creating a splash but this splach is stopping my App, it works for a few seconds then automatically closes my App stops working and does not open anymore.
public class Splash extends AppCompatActivity {
private final int SPLASH_DISPLAY_LENGTH = 3000;
@Override
protected void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
ActionBar actionBar = getSupportActionBar();
if(actionBar != null){
actionBar.hide();
}
new Handler().postDelayed(new Runnable(){
@Override
public void run(){
Intent startActivityIntent = new Intent(Splash.this, AuthUIActivity.class);
startActivity(startActivityIntent);
Splash.this.finish();
}
}, SPLASH_DISPLAY_LENGTH);
}
}