title: How to avoid dismissing my progress dialog when the user touches the screen?
body: <p>I'm working on an android project which displays a progress dialog when the user downloads a file.</p>
  
  <p>But when the user touches the screen, the progress dialog is dismissed without waiting the 100%.
  I already tried to use this:</p>
  
  <pre><code> public boolean onTouchEvent(MotionEvent e) {
          return true;
      } 
  </code></pre>
  
  <p>But it's not working.</p>
  
  <p>How can I avoid this?</p>
  
  <p><strong>UPDATE 1:</strong></p>
  
  <p>It seems that setCancelable(false) works fine. Thanks you very much for your answers but when the downloading long-lasting and the user decides to abandon it'll be impossible because I already deactivated the back keyCode:</p>
  
  <pre><code>@Override
  public boolean onKeyDown(int keyCode, KeyEvent event) {
      if (keyCode == KeyEvent.KEYCODE_BACK) {
          return true;
      }
      return super.onKeyDown(keyCode, event);
  }
  </code></pre>
  
  <p>How can I figure this out?</p>