Mi actividad abre un cuadro de diálogo. Cuando se cierre necesito que se ejecute la función ReloadTable()
. Así que estoy tratando de usar setOnDismissListener
pero no se activa. ¿Podría alguien por favor ayudar a lo que estoy haciendo mal?AlertDialog setOnDismissListener no funciona
Gracias!
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();
Esta es la razón por la que no funciona para usted, probablemente: http://stackoverflow.com/ a/18269965/89818 – caw