AlertDialog.show() leaks when phone rotates

by Mark Wyszomierski » Fri, 18 Dec 2009 07:27:25 GMT


Sponsored Links
 Hi,

There are lots of code samples on third party sites where an alert
dialog is built and shown like this:

    new AlertDialog.Builder(context).setMessage("Test.").show();

If the dialog is left open when the phone rotates, it seems to leak:

12-17 18:23:47.543: ERROR/WindowManager(2440): Activity
com.test.ActivityMain has leaked window
com.android.internal.policy.impl.phonewindow$decorv...@43775a28 that
was originally added here
12-17 18:23:47.543: ERROR/WindowManager(2440):
android.view.WindowLeaked: Activity com.test.ActivityMain has leaked
window com.android.internal.policy.impl.phonewindow$decorv...@43775a28
that was originally added here
12-17 18:23:47.543: ERROR/WindowManager(2440):     at
android.view.ViewRoot.<init>(ViewRoot.java:214)
.... etc ...

We can use the showDialog() methods, but the above does come in handy
sometimes. Is there a proper way to clean up dialogs created in this
manner?

Thanks

--



AlertDialog.show() leaks when phone rotates

by Romain Guy » Fri, 18 Dec 2009 08:04:40 GMT


 Just call theDialog.dismiss() from onDestroy().



>


Sponsored Links


Other Threads

1. How to get android fs from sdk1.0

Hello,
   I am trying to port android1.0 to my omap2430 board. I have ported the
android m5-rc14 file system, and it works well.
   But when I tried to extract the file system from 1.0 as I did from
m5-rc14. the android's shell reports "Read-only file system". Any suggestion
to solve it?

   Thanks very much!

Jerry

--~--~---------~--~----~------------~-------~--~----~

2. Exchange Server Support

Hi All,

This isn't another thread asking if exchange server is supported on
Android... so don't worry :P

I just wanted to start a dialog with other developers about how to
possibly tackle the MS Exchange support issues on Android.

I'm not the best coder in the world, so I can't really provide example
code or anything, but this is more of a discussion-type thread.

get mail (correct me if I'm wrong). So I started looking @ opensource
implementations of Java WebDAV clients and came across Apache SLIDE
Server and Client. Unfortunately Slide has been discontinued. There is
not that it was replaced by Apache JackRabbit, but from what I can see
JackRabbit is a Server implementation of WebDAV technologies.

I was also searching for Java MAPI support, but a lot of the MAPI APIs
for Java are closed-source and licensed... which is not good IMHO.

What other options for exchange support do people see? Do you think it
is a worthwhile pursuit? Do you think it will happen and will it be a
paid-for product on AndroidMarket, or will someone make an open-source
client?

There is a lot of reading to be done on WebDAV and how it integrates
into Exchange... so I am going to start doing some reading.

Feel free to share your ideas and thoughts.
--~--~---------~--~----~------------~-------~--~----~

3. Adding frames into an Image

4. email attatchments

5. getListView().setTextFilterEnabled(true) get the filter text problem

6. My list of improvements.

7. android.graphics, drawing paths, and patterns