title: Android: How to override onBackPressed() in AlertDialog?
body: <p>I have an <code>AlertDialog dlgDetails</code> which is shown from another <code>AlertDialog dlgMenu</code>. I would like to be able to show dlgMenu again if the user presses the back button in dlgDetails and simply exit the dialog if he presses outside the dialog.</p>
  
  <p>I think the best way to do this is to override <code>onBackPressed</code> for dlgDetails, but I am not sure how to do that since AlertDialogs must be created indirectly using the Builder.</p>
  
  <p>I am trying to create a derived AlertDialog (<code>public class AlertDialogDetails extends AlertDialog { ...}</code> ) but then I guess I must also extend <code>AlertDialog.Builder</code> in that class to return an AlertDialogDetails, but isn't there a simpler way? And if not, how would you go about overriding the Builder?</p>