public class SplashScreen extends Activity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash_screen);
try {
Thread.sleep(5000);
} catch(InterruptedException ex) {
Thread.currentThread().interrupt();
}
Intent LoginActivity = new Intent(SplashScreen.this, LoginActivity.class);
startActivity(LoginActivity);
finish();
}
}
with activity_splash_screen
is layout of splash screen. My app has displayed white screen instead of my splash-image.
when I do not set the next action LoginActivity
my splash-image comes back!
public class SplashScreen extends Activity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash_screen);
try {
Thread.sleep(5000);
} catch(InterruptedException ex) {
Thread.currentThread().interrupt();
}
// Intent LoginActivity = new Intent(SplashScreen.this, LoginActivity.class);
// startActivity(LoginActivity);
finish();
}
}