use:
progressDialog.setCanelable(true);
progressDialog.setCanceledOnTouchOutside(false);
instad of  setOnKeyListener