Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does AlertDialog.Builder not have setOnDismissListener or setOnShowListener methods?

I want to use the fluid interface of AlertDialog.Builder but when I get to the point of adding my DismissListener and ShowListener I have to break out and add it to the dialog object after I do my create() on the builder. Does anyone know why they're not on there? I can't extend it because of the private P member... It's not the end of the world or anything, I'm just curious why it's not there.

like image 597
danb Avatar asked Jan 20 '12 16:01

danb


1 Answers

Have You Tried this method..

AlertDialog dlg = builder.create();
lg.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(final DialogInterface dialog) {
//Do some work
}
});
return dlg;
like image 177
coder_For_Life22 Avatar answered Oct 06 '22 01:10

coder_For_Life22