In my app i want to have a delay of 5 seconds and in this five seconds user should see progress dialog i tried this
progressdialog.show();
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
progressdialog.dismiss();
but while Thread is sleeping the progessdialog also wont show .