I' using ProgressDialog to show the user that he has to wait and to make the surface of my app "untouchable" while the user has to wait. I added a Button to the progressDialog which should start some actions if certain conditions are true. The problem is that everytime the user press the button the progressDialog gets automatically dismissed. Even if no action is triggered. How can I prevent the progressDialog from getting dismissed when onClick is called?
thx & regards
EDIT:
connectingDialog = new ProgressDialog(this);
connectingDialog.setCancelable(false);
connectingDialog.setCanceledOnTouchOutside(false);
connectingDialog.setButton(DialogInterface.BUTTON_NEUTRAL, "start", new DialogInterface.OnClickListener(){
@Override
public void onClick(DialogInterface arg0, int arg1) {
/*if(isPrepared)
startGame();*/
connectingDialog.show(); // does not work, too
}
});
connectingDialog.show();
android.R.string.ok
instead of "OK" – Pelops