Thanks ... this is very helpful. I am indeed using Dialog.show(). If I
move
to Activity.showDialog(int) it's not clear to me how to get hold of
the
id of my Dialog, since I don't specify one when creating it. Here is
the code snippet:
// Create a general message box
AlertDialog.Builder messagebuild = new AlertDialog.Builder(this);
messagebuild.setPositiveButton("OK", this);
message = messagebuild.create();
// Create the message handler which will handle messages
messageHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
if(msg.what == SAVEFILEERROR) {
message.setTitle("Error");
message.setMessage("this error");
// replace message.show()
//message.show();
message.getOwnerActivity().showDialog(id???);
}
}
};
How do I assign or retrieve the id of the Dialog created by
AlertDialog.Builder?
Thanks!
On May 6, 12:13 pm, TreKing <[email protected]> wrote:
> On Thu, May 6, 2010 at 1:28 PM, Julian Bunn <[email protected]> wrote:
> > And, even if it was, it's not clear to me what I would need to do to
> > avoid the AlertDialog from disappearing!
>
> How are you showing the dialog? If you're using Activity.showDialog(int), it
> will maintain the dialog's state and keep it shown across orientation
> change. If you're just using Dialog.show(), it's up to you to restore the
> dialog's state. Prefer the former over the latter.
>
> -------------------------------------------------------------------------------------------------
> TreKing - Chicago transit tracking app for Android-powered
> deviceshttp://sites.google.com/site/rezmobileapps/treking
>
> --
> 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
> athttp://groups.google.com/group/android-developers?hl=en
--
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