Is there a way to use my own Dialog-extended class with an AlertBuilder style? Right now I have:
@Override
protected Dialog onCreateDialog(int id) {
LayoutInflater inflater = LayoutInflater.from(this);
switch (id) {
case MY_DIALOG:
View view = inflater.inflate(R.layout.my_dlg_layout, null);
AlertDialog dlg = new AlertDialog.Builder(this)
.setView(view)
.create();
return dlg;
}
return null;
}
But it’s getting too crazy, and I’d like to move the dialog definition into its own class. (the above doesn’t look too bad, I’m skipping a lot for the sake of clarity – basically I’m using a somewhat complicated custom view with AlertBuilder).
I very much want to use Dialog Fragment, but am not ready to do it yet, I need to build this as a temporary thing.
Thanks
1 Answer