24.02.2011 16:19, hoyski ?????:
For the moment, I'm testing if the dialog interface equals either of
my dialog instances held by the activity, e.g. if (d == mOptionsDlg).
That works but it feels brittle to me.
Sounds fine - Dialog impelments DialogInterface, and since you know
you're not creating other classes that implement DialogInterface, there
shouldn't be any unexpected values here.
Anyone know a better way? Or should I just stick with the instance
comparison?
You could implement little "stubs" for onDismiss listener for the dialogs:
*dialog_1*.setOnDismissListener(new OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
myActivity.myDialogDismissed(*DIALOG_1*);
}
});
*dialog_2*.setOnDismissListener(new OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
myActivity.myDialogDismissed(*DIALOG_2*);
}
});
-- Kostya
--
Kostya Vasilyev -- http://kmansoft.wordpress.com
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en