I would like to display a splash screen while everything is initializing in the onCreate() method, yet components that I need to draw things to the screen are also initializ
//avoid time consuming work in UI thread but if that is related to UI itself then do as below
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.first_splash_lauoy);
new Handler().postDelayed(new Runnable() {
public void run() {
//Your time consuming work
//with spiiner(if needed) & setContentView(<finalView>)
}, 1000);
}
}
Create a XML layout for this splash screen and set it as content view right after your super.onCreate():
super.onCreate(savedInstanceState);
setContentView (R.layout.splash_screen);
That should be enough. It would display this splash screen until your setContentView(renderView) is called.