我的活动打开一个对话框。当它关闭时,我需要ReloadTable()
执行该功能。所以我正在尝试使用setOnDismissListener
但它没有被触发。有人可以帮助我做错什么吗?
谢谢!
AlertDialog.Builder builder;
AlertDialog alertDialog;
Context mContext = getApplicationContext();
LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(LAYOUT_INFLATER_SERVICE);
View layout = inflater.inflate(R.layout.transaction, null);
builder = new AlertDialog.Builder(new ContextThemeWrapper(TransactionsList.this , R.style.dialogwithoutdim));
builder.setView(layout);
alertDialog = builder.create();
alertDialog.setOnDismissListener(new OnDismissListener() {
public void onDismiss(final DialogInterface dialog) {
ReloadTable();
}
});
builder.show();