title: When i use type keyguard dialog then my screen stops working
body: <p>I am developing a Lock Screen App that will lock the screen as well as apps that the user want to.
  Lock can be pin code or pattern lock and so far now when I activate a pin code or pattern lock then a lock screen appears on the screen when user Reboot or off the screen, the problem I am facing right now is that, I can't disable my Home button and Task manager button.</p>
  <p>What I have tried soo far is
  I have added the</p>
  <pre><code>getWindow().addFlags(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
  </code></pre>
  <p>after adding this, Home button and Task Manager button is still enabled and my screen freezes, if I touch something on the screen its not performing anything and when I press Home button the lock screen disappear.</p>
  <p>I also have added this too</p>
  <pre><code>@Override
      public void onBackPressed() {
          return;
      }
  
      // Handle button clicks
      @Override
      public boolean onKeyDown(int keyCode, android.view.KeyEvent event) {
  
          if ((keyCode == KeyEvent.KEYCODE_VOLUME_DOWN)
                  || (keyCode == KeyEvent.KEYCODE_POWER)
                  || (keyCode == KeyEvent.KEYCODE_VOLUME_UP)
                  || (keyCode == KeyEvent.KEYCODE_CAMERA)) {
              return true;
          }
          if ((keyCode == KeyEvent.KEYCODE_HOME)) {
  
              return true;
          }
          return false;
  
      }
  
      // handle the key press events here itself
      public boolean dispatchKeyEvent(KeyEvent event) {
          if (event.getKeyCode() == KeyEvent.KEYCODE_VOLUME_UP
                  || (event.getKeyCode() == KeyEvent.KEYCODE_VOLUME_DOWN)
                  || (event.getKeyCode() == KeyEvent.KEYCODE_POWER)) {
              return false;
          }
          if ((event.getKeyCode() == KeyEvent.KEYCODE_HOME)) {
  
              return true;
          }
          return false;
      }
  </code></pre>
  <p>after adding this, back button is disabled successfully working but Home button is still enabled and funtioning.</p>