I built an AlertDialog in this class file, and the dialog box is coming up fine, however the methods dont seem to be calling when a click is performed. What am I doing wrong? Thanks for your help!
//AlertView Builder
final AlertDialog.Builder builder;
builder = new AlertDialog.Builder(this);
builder.setTitle(" ");
builder.setIcon(R.drawable.banner);
builder.setMessage("Share this picture using any of the below!");
builder.setPositiveButton("Email",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
System.out.print("Emailing...");
}
});
builder.setNeutralButton("Facebook",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
System.out.print("Facebooking...");
}
});
builder.setNegativeButton("Twitter",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
System.out.print("Tweeting...");
}
});
What are you expecting it to do? do you have any code in those blocks that you don’t have up there right now?
Android doesn’t by default use
System.out.print();for anything – use Log: