public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final ProgressDialog dialog = ProgressDialog.show(MyActivity.this, "", "Loading. Please wait...", true);
Thread t = new Thread(new Runnable(){
public void run() {
try{
Thread.sleep(5000);
} catch (InterruptedException e) {
// no-op
}
dialog.dismiss();
}
});
t.start();
}
Redeploy (mvn clean install) and the dialog will show for 5 seconds before going away.
No comments:
Post a Comment