ProgressDialog in Thread stopps when closing G1

by Manfred » Fri, 06 Mar 2009 16:24:02 GMT

Sponsored Links

I have a Progress Dialog in an extra Thread running. Normally the user
will have the keyboard open, because something is to insert! So when
the Progress Dialog appears and the user close the keyboard, the
dialog dissappears and the application crashes. In the debugger i saw
the exception "View not attached to window manager". May because the
Dialog is not longer shown but the application want to remove it after
the calculation?

Here is the code where i start the dialog and the thread:
        myProgressDialog =,
                                "Please wait...", "Calculating..", true);
        new Thread()
            public void run()
                                        //Doing some stuff....
                                catch (Exception e)
                                        alertText = e.getMessage();


Does somebody know how to solve this?


ProgressDialog in Thread stopps when closing G1

by Manfred » Fri, 06 Mar 2009 16:53:59 GMT



Sponsored Links

ProgressDialog in Thread stopps when closing G1

by Manfred » Fri, 06 Mar 2009 20:36:40 GMT

 For all who have the same problem, this helps:

Override this method:
        public void onConfigurationChanged(Configuration arg0)
                //Toast.makeText(this, "onConfigurationChanged",

And in Manifest XML insert this line in the activity tag:

Now you have to handle yourself changes on orientation and
keyboardHidden, and as you can see in the overridden method, i do
nothing. So the onCreate() Method is not called if the orientation
changes or if the keyboard is slided out or in and therefore the
dialog do not dissappear!


ProgressDialog in Thread stopps when closing G1

by MrSnowflake » Sat, 07 Mar 2009 23:07:06 GMT

 lso using showDialog() and corresponding onCreateDialog and
onPrepareDialog() will have dialogs survive configuration changes!
(and it's a lot easier :)).

On 6 mrt, 13:36, Manfred <> wrote:

Other Threads

1. If you wondered why alternative app markets exist...

Are you sure the link is right? I'm just seeing something about wordpress

Shane Isbell (Co-founder of SlideME - The Original Market for Android)


2. What is the intended usage of the "Next" and "Done" keys on the soft keyboard

The "Next" key seems to move to the next item that could interact with
the keyboard.

The "Done" key is less clear to me.  It sends in a
event.  Is it possible to distinguish this event from the down-and-
left-arrow key
that also sends in a KeyEvent.KEYCODE_ENTER?  It appears that you get
either but not both "Done" or down-and-left-arrow buttons on the soft

Am I missing some documentation about this?

Is it "good UI" to have the "Done" key execute the action that would
be done on an "OK" button?  E.g. for a username and password dialog
that has
two text fields and an OK button the user touches the username field,
the soft keyboard, types, presses "Next", types, presses "Done" and
dialog submits the username and password and goes away.

Or is it "good UI" to force the user to explicitly touch the OK
button?  Possibly
having to also manually dismiss the soft keyboard if it covers up the
OK button.



3. Large number of Contacts - DB corruption

4. Map not working (again)

5. OpenGL 2D Game Framework

6. coarse versus fine location provider

7. Virtual touch area for an ImageButton