title: How to show an AlertDialog juste after a ProgressDialog
body: <p>I searched across the web but I didn't find any satisfying answer.</p>
  
  <p>I have a task that can make some time to complete so I use a ProgressDialog to inform the user that the application is doing something.</p>
  
  <p>If an error is encountred during the long task, I want to display an AlertDialog to let the user know about the error.</p>
  
  <p>So I wrote the code but the ProgressDialog dismisses and the AlertDialog doesn't show.</p>
  
  <p>I use the onCreateDialog() method to manage my dialogs.</p>
  
  <p>Someone knows why?</p>
  
  <p>Thank you.</p>