title: dismissing Progress Dialog
body: <p>I have a situation where I am loading a bunch of images. During this process, I am trying to show a progress Dialog until the images get loaded fully. I have <code>overrided</code> the <code>onBackPressed()</code> method, such that when the user presses the back button, the activity will be finished. </p>
  
  <p>But if I press the back button when the progress dialog is being displayed, the back key event was not called. So I tried providing <code>progressDialog.setCancelable(true)</code>. So this now allows me to dismiss the progress Dialog, but my back key event is not being called anyway and so my activity loads images in the background.</p>
  
  <p>So how do I make both the <code>progressDialog</code> and activity to be stopped when the user presses the back key. </p>