How to return value from new object instance method declaration (nested)?
<p>Ok this is the code:</p>

<p>public boolean alertDialog(String message){</p>

<pre><code>    AlertDialog.Builder builder = new AlertDialog.Builder(this);
    builder.setMessage(message).setCancelable(false).setPositiveButton("Yes",        new DialogInterface.OnClickListener() {

        public void onClick(DialogInterface dialog, int which) {
            // TODO Auto-generated method stub
            TestBedAppActivity.this.agree = true;
        }
    }).setNegativeButton("Cancel", new DialogInterface.OnClickListener() {

        public void onClick(DialogInterface dialog, int id) {
            TestBedAppActivity.this.agree = false;
            dialog.cancel();
        }

    });

    AlertDialog alert = builder.create();
    alert.show();

}
</code></pre>

<p>Inside the setPositiveButton() methos there is a nested declaration of the method onClick(). I want to return the boolean result for the main method alertDialog(String message) but I cannot do it. What am I missing? Help!!!!!!!</p>
