Re: [android-developers] Re: AlertDialog and keyboard open configuration change

2010-05-06 Thread TreKing
On Thu, May 6, 2010 at 5:00 PM, Julian Bunn  wrote:

> I decided to manage the Dialog myself, using dismiss() and show() and it
> works nicely now.
>

Just out of curiosity, why? This is more work and more complicated,
especially with the saving and restoring the state.

-
TreKing - Chicago transit tracking app for Android-powered devices
http://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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: AlertDialog and keyboard open configuration change

2010-05-06 Thread Julian Bunn
Thanks ... yes, I had already read that.

I decided to manage the Dialog myself, using dismiss() and show() and
it works nicely now.

One thing I had not realised is that a dismiss() is needed in
OnDestroy() ... without that,
a show() in OnCreate() will not work. That was the root cause of my
trouble.



On May 6, 2:29 pm, TreKing  wrote:
> On Thu, May 6, 2010 at 3:53 PM, Julian Bunn  wrote:
> > How do I assign or retrieve the id of the Dialog created
> > by AlertDialog.Builder?
>
> The dialog itself does not have an ID - it's for th Activity to map to the
> correct dialog it manages.
> See this and come back with any 
> questions:http://developer.android.com/intl/fr/guide/topics/ui/dialogs.html#Sho...
> 
> -
> 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 android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> 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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: AlertDialog and keyboard open configuration change

2010-05-06 Thread TreKing
On Thu, May 6, 2010 at 3:53 PM, Julian Bunn  wrote:

> How do I assign or retrieve the id of the Dialog created
> by AlertDialog.Builder?
>

The dialog itself does not have an ID - it's for th Activity to map to the
correct dialog it manages.
See this and come back with any questions:
http://developer.android.com/intl/fr/guide/topics/ui/dialogs.html#ShowingADialog

-
TreKing - Chicago transit tracking app for Android-powered devices
http://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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: AlertDialog and keyboard open configuration change

2010-05-06 Thread Julian Bunn
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  wrote:
> On Thu, May 6, 2010 at 1:28 PM, Julian Bunn  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 android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> 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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en