大家好,看看下面的代码......我在我的应用程序中使用了进度条,但是当我使用 dialog.dismiss() 时它没有显示,但如果我不使用这个方法会显示,但问题是它不会消失....任何帮助家伙...?
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage("Are you sure you want to delete?")
.setCancelable(false)
.setPositiveButton("Yes",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int id) {
`ProgressDialog` dialog1 = ProgressDialog.show(context, "", "Deleting...",true);
// Log.v("", "You Clicked " + s);
dba.delete("messages", "private = 0 and _id=?",
new String[] { s });
dba.close();
populate();
}
})
.setNegativeButton("No",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int id) {
dialog.cancel();
}
});
AlertDialog alert = builder.create();
alert.show();
dialog1.dismiss();