Gracefully destroying Dialog box

by Neilz » Fri, 23 Oct 2009 20:11:55 GMT


Sponsored Links
 Hi. I have an activity which pops up a Dialog box, to get some text
input from the user. The problem arises when you switch orientation.
The Dialog disappears, so I have added code to set and check flags in
the savedInstanceState, meaning that the Dialog is displayed again in
these circumstances.

However, the dialog isn't being closed gracefully when the orientation
is switched. I get the following error:


10-23 12:53:54.385: ERROR/WindowManager(2852): Activity
com.bla.bla.Bla has leaked window
com.android.internal.policy.impl.phonewindow$decorv...@435ceda0 that
was originally added here
10-23 12:53:54.385: ERROR/WindowManager(2852):
android.view.WindowLeaked: Activity com.bla.bla.Bla has leaked window
com.android.internal.policy.impl.phonewindow$decorv...@435ceda0 that
was originally added here


I know when the window is going to be closed, but can't find a way of
closing it manually. I open it with alert.show();  ...but there
doesn't seem to be any corresponding alert.destroy() method or
similar.

Any ideas how I can manually close the dialog box without user input?
--~--~---------~--~----~------------~-------~--~----~



Gracefully destroying Dialog box

by Neilz » Sat, 24 Oct 2009 16:46:35 GMT


 Oh well. Maybe I should raise it as a bug, as this is a problem to me,
and it seems there should be a standard method to the effect of
alert.close();



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


Sponsored Links


Gracefully destroying Dialog box

by Lance Nanek » Sat, 24 Oct 2009 17:13:00 GMT


 You can close a dialog using its dismiss() method :
 http://developer.android.com/intl/fr/reference/android/app/Dialog.html #dismiss%28%29

You might want to consider having the activity manage restoring your
dialog for you as well:
 http://developer.android.com/intl/fr/reference/android/app/Activity.html #onCreateDialog%28int%29




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



Other Threads

1. Disable hardware codecs

Hello   ,

I have a file a audio/3gp file that I can play in eclair-2.1 emulator but
its throwing error on my Zoom2
device  says "Sorry , this player doesn't support this  type of audio file "
.

emulator will be using s/w codecs . while zoom2 has h/w codecs . The logic
of  MMM framework is like if h/w codecs are not present it should look for
s/w codec . if zoom2 is not finding h/w codec for my audio/3gp file , it
should search for s/w codec and play file , why does it fails with error ?

How to disable hardware acceleration of codecs ?

Please correct me If I am wrong .




Thanks :
Uander

-- 

2. Solved WTA: Bla*pk mendadak ga ada icon setelah update

ternyata ga boleh install yg backupan di appmanager pro.. :(

Abis install ulang dari site resminya, baru deh jalan n icon2 muncul lagi
abis update..




Make versi yang berape pasar Malam atau supirtembaknya? Kalo 1.08 emg sering
banget force close ganti ke 1.06 / 1.20 dijamin lancar jaya
Ibro sent with g-spica 2.1 xdj4




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

3. Fwd: antara cursorsense dan super eclair

4. Run android apps on ubuntu

5. Listen to the CheckBox event in a ListActivity

6. lightweight minimalist hardware for android

7. Which Intent Flags when setting PendingIntents in multiple app widget scenario?