Hi, i'd like to show a dialog, like when i use showDialog(...) on the Activity, but i need to do that on a widget, so i can't use showDialog(...). How can i do that?
I tried this on my onReceive method but it crash:
AlertDialog.Builder builder;
builder = new AlertDialog.Builder(context);
builder.setMessage("Are you sure?")
.setCancelable(false)
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
db.open();
db.remove_last();
db.close();
dialog.dismiss();
}
})
.setNegativeButton("No", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});
builder.show();
Thanks, Valerio