title: Android Device's Home and Menu Buttons
body: <p>I want nothing to do,When I click the home button and menu button. I wrote a code. I have got all android devices.Code is running Samsung devices, but code isn't running other adroid devices.Please help.</p>
  
  <pre><code>import static android.view.WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL;
  import static android.view.WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED;
  import static android.view.WindowManager.LayoutParams.TYPE_SYSTEM_ERROR;
  
          WindowManager.LayoutParams params = getWindow().getAttributes();
          params.type = TYPE_SYSTEM_ERROR;
          getWindow().setAttributes(params);
          getWindow().setFlags(FLAG_SHOW_WHEN_LOCKED | FLAG_NOT_TOUCH_MODAL, 0xffffff);
  </code></pre>
  
  <p>Permissions</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.DISABLE_KEYGUARD"/&gt;
  </code></pre>