Possible Duplicate:
Android ASync task ProgressDialog isn't showing until background thread finishes
I am implementating an android app. I have following Activity 1.StartMenu:-In This Activity there is three button when i press Start. it moves on Another Activity AndroidGame. in Androidgame There is context of Main game panel.so it start executing game. I want that when maingamepanel loads it show a progressDilog .after selecting yes it should start game.I am unable to progress dialog. please suggest where should progressDialog kept? AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder( this);
// set title
alertDialogBuilder.setTitle("Your Trial Period has Expired.");
// set dialog message
alertDialogBuilder.setCancelable(false).setPositiveButton("Ok",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
}
});
// create alert dialog
AlertDialog alertDialog = alertDialogBuilder.create();
// show it
alertDialog.show();