title: alertDialog in onItemClick
body: <p>I have an alertDialog inside my ListView's onItemClick().</p>
  
  <pre><code>public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
       AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(FragmentActivity.this);
         alertDialogBuilder
         .setMessage("Do you wish to save any new/updated defects?")
         .setCancelable(false)
         .setPositiveButton("Yes",new DialogInterface.OnClickListener() {
             public void onClick(DialogInterface dialog,int id) 
             {
                  saveMe();
             }
         })
         .setNegativeButton("No",new DialogInterface.OnClickListener() {
             public void onClick(DialogInterface dialog,int id) {
                 dialog.cancel();
             }
         });
         AlertDialog alertDialog = alertDialogBuilder.create();
         alertDialog.show();
  </code></pre>
  
  <p>This dialog box is created only after the entire <code>onItemClick()</code> is executed. This will result in the dialog box appearing after the new item in the menu is shown.
  I want the dialog box to appear before the menu item is selected and shown. How can that be done?</p>