title: Prevent back button from closing a dialog box
body: <p>I am trying to prevent an AlertDialog box from closing when pressing the back button in Android. I have followed both of the popular methods <a href="https://stackoverflow.com/questions/4779954/disable-back-button-in-android">in this thread</a>, and with System.out.println I can see that in both cases the code executes. However, the back button <em>still</em> closes the dialog box.</p>
  
  <p>What could I be doing wrong? Ultimately I'm trying to prevent the back button closing a dialog box - it is a disclaimer that is displayed the first time the app is run and I don't want the user to have any option but to press the "Accept" button in order for the app to continue.</p>