I want to have a splash screen show up for a few seconds before a dialog pops up. However when I load my app the dialog and the background screen show up at the same time. What can I do to show the background image of my splash.xml before the dialog appears.
Thread waitabit=new Thread(){
public void run(){
try{
sleep(2000);
}catch(Exception e){
e.printStackTrace();
}
}
};waitabit.start();
Putting the above before my dialog just makes it dark for 2 seconds before showing everything all at once. Calling my dialog inside of the thread causes and error because we cant put dialogs in a thread.
Thanks
Try putting the above code in an AsyncTask so that the UIThread does not sleep.