*> I'm not sure I understand the question? If I don't rotate the phone,
it doesn't run out of memory. It also appears to not run out of memory
when the AlertDialog is not displayed.
*
Your description said that you rotate the phone 30 times without displaying
the dialog.  After that, you rotate the phone 9 times while the dialog was
displayed.  Sorry for not being clear, but I wanted to know how many times
it takes to run out of memory when you skip the first part (rotating without
the dialog) and only rotate your phone when the dialog is visible...

I was wanting to get more info as to where the memory leak could be
happening.  There were two scenarios that could have caused the leak here,
and I wanted to be able to narrow it down to one of them.

But it appears the problem may have already been answered, so my question
becomes irrelevant at this point.

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


On Tue, Mar 22, 2011 at 3:53 PM, Miguel Morales <[email protected]>wrote:

>
>> I didn't know about the deprecation, but now that you mention it the
>> showDialog(int) method is deprecated, but they've replaced it with
>> showDialog(int, Bundle), which should work the same way.
>>
>>
> Ah, ok yeah I see that method.  According to the docs, onCreateDialog
> should only be called ONCE in the lifetime of the dialog.  (if I read
> correctly.)  In your case, it may be getting called more than once hence
> creating a new dialog on each rotation and having android hang on to the
> reference.
>
> From a quick google search I came accross this:
> http://androidzteam.com/wpv/?p=44
>
>
>> The benefit to using showDialog is that it handles rotation for me, so
>> the dialog is still there even when the user rotates the phone. And no
>> extra code on my part.
>>
>>
> Ah ok, yeah seems like that's the way to go to avoid dealing with dialogs
> too much.
>
>
>> What benefit is there to keeping track of your own references?
>>
>>
> Well, for one thing I can close the dialog in any other method I choose.
> I also keep full control of the lifetime of the dialog and don't have to
> worry about any leaks or bugs.
> However, I agree that for your use case perhaps onCreateDialog might be
> simpler.
>
> Try the link above and see if that answers your question.
>
>
>> And why aren't my replies showing up in the thread? Did I reply
>> directly to your email instead of the group?
>>
>>
> They show up just fine for me, perhaps someone with more experience with
> onCreateDialog can help.
>
>
>>  --
>> 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
>>
>
>
>
> --
> ~ Jeremiah:9:23-24
> Android 2D MMORPG: http://solrpg.com/
> http://www.youtube.com/user/revoltingx
>
> --
> 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
>

-- 
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

Reply via email to