You have to set the cancellable property of your ProgresDialog to false:
protected void onPreExecute(){
pDialog = new ProgressDialog(MyActivity.this);
pDialog.setMessage("Waiting...");
pDialog.setCancelable(false);
pDialog.show();
}
This makes sure that the progressDialog does'nt disappear when u click anywhere else other than the dialog.