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. Wifi drop Issues on Motorola Droid

I am trying to develop a streaming application and I am testing it on
multiple devices. But I am seeing some problems on Motorola Droid with
regards to wifi connection. The wifi connection drops occasionally and
comes back in 30 seconds to 1 minute on the Droid. Sometimes while in
the middle of streaming I get network connection errors even though I
am standing very next to the wifi router. I am not finding this
problem with any other devices. Has anyone found any similar issues
with the Droid? Any idea what can be done in my program to fix this?

Thanks
KK

-- 

2. Help Cara Menggembalikan partisi sdcard ke kapasitas semula

malam..mas..dan suhu dan suhi sekalian

saya sudah partisi sdcard saya..klo cara mengembalikan ke kapasitas
semula bagaimana ya???
tolong pencerahannya...
terus banyak aplikasi yg ngga bisa terinstal setelah di partisi
sdcardnya..itu kenapa ya..padahal sebelum dipartisi apliksi itu bisa
di instal......
(cth: dropcap, handsms,camera pro, doc to go, DLL)

terima kasih

Arisandy.

-- 
"Indonesian Android Community [id-android]" 

3. android.jar In The SDK Only Has The API And Not The Implementation?

4. android.jar In The SDK Only Has The API And Not The Implementation?

5. OOT: Mirink dadakan

6. What is R.java

7. RE : How to debug