views:

33

answers:

3

Hi,

When I try to open a dialog in a worker thread, the dialog opens and then the whole application crashes. It is an android app.

I get the following error (i cant post the image because i have less then 10 points :(()

Any help will be appreciated :)

Best Regards

+1  A: 

All UI work must be done on the main event/UI thread. To do work in the background, look at using AsyncTask. You can show a progress dialog, start the task, update the dialog with status via onProgressUpdate, and then close the dialog in onPostExecute.

Mayra
A: 

I think you should use handler to do what you want. In worker thread, you post a message to the handler, and the handler opens the dialog when receiving this message.

taniGroup