protected Dialog onCreateDialog(int id) { switch (id) { case 0: mProgress = new ProgressDialog(this); mProgress.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL); mProgress.setTitle("Updating"); mProgress.setMessage("Wait..."); mProgress.setCancelable(false); mProgress.setButton( "Cancel", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { mQuit = true; dismissDialog(0); } }); return mProgress; } return null; }