title: How to show a dialog on top of a locked screen with Jelly Bean
body: <p>I have an Eclair based app that shows a full screen dialog on a locked phone. The dialog appears, and once the dialog disappears (because a user clicked a button on it), the locked screen is shown to the user for them to enter a passcode. All desired behaviour.</p>
  
  <p>This is the snippet that works</p>
  
  <pre><code>getWindow().addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
  getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
  getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
  setContentView(R.layout.alertdialog);
  </code></pre>
  
  <p>When I install this app on a Nexus 7 with Jelly Bean, I do not get the same behaviour. The tablet wakes up and shows the locked screen for the user to enter a passcode. No dialog is presented on top of the locked screen. I enter the passcode and I still do not see the dialog anywhere. Has the way to accomplish the same behaviour changed in a recent release? Is there another way to do this?</p>