When I click on item not showing alertdialouge?
<p>I want to display alert dialogue on click of pdfimage, I try following code but not showing alertdialogue .  </p>

<pre><code>private OnItemClickListener itemClickListener=new OnItemClickListener() {
  @SuppressWarnings("rawtypes")
  public void onItemClick(AdapterView parent, View arg1, int position, long arg3) {
      int i=position;
      pdf=pdfarray[i];
 /*******************************/
  AlertDialog.Builder builder = new AlertDialog.Builder(ImageShowActivity.this);
    final AlertDialog alert = builder.create();
    builder.setMessage("Are you sure you want to exit?")
       .setNeutralButton("Cancel",new DialogInterface.OnClickListener(){
       public void onClick(DialogInterface dialog, int id) {
            alert.dismiss();   
           }
        })
       .setPositiveButton("Download", new DialogInterface.OnClickListener() {
       public void onClick(DialogInterface dialog, int id) {
           Intent intent=new Intent(ImageShowActivity.this,OpenPDFNew.class);
           intent.putExtra("pdfurl",pdf );
           startActivity(intent);
           }
       })
      .setNegativeButton("Online", new DialogInterface.OnClickListener() {
           public void onClick(DialogInterface dialog, int id) {
           }
   });
    alert.show();
/****************************************/
 }
};
</code></pre>
