Returning values through a Dialog
<p>I currently have a method which should return the result of a dialog. The code I am using is</p>

<pre><code> private int ShowDialog(String FileName)
 {
      AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
      // set title
      alertDialogBuilder.setTitle("Play File");

            // set dialog message
            alertDialogBuilder
                .setMessage("Would you like .... file")
                .setCancelable(false)
                .setPositiveButton("Yes",new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog,int id) 
                    {
                        dialog.cancel();
                        return 1;
                    }
                  })
                .setNegativeButton("No",new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog,int id) {
                        dialog.cancel();
                        return 0;
                    }
                });

             AlertDialog alert11 = alertDialogBuilder.create();
             alert11.show();

 }
</code></pre>

<p>But it seems like the onClick method should be a void. Is there anyway by which I can make this method return a value and in return cause the ShowDialog method to return that value.?</p>
