Hi!

I've created ProgressDialog with a second thread according to the
DevGuide:
   http://developer.android.com/guide/topics/ui/dialogs.html#ProgressDialog
It works great till user:

1) changes screen orientation or
2) hits the back button twice (first to hide the dialog, second to
hide the app) to hide the application and run the app again after a
while.

Then, onCreate() is called (for the second time), and progress bar
stops responding properly. My thread may work for a few minutes and I
want to give the user possibility to hide it and do sth else. After a
while he might want to run the app again in order to check the
progress.

I found a few articles concerning this topic, but I couldn't find the
exact solution I should chose for this problem. So, could you tell mi
what is the proper way to handle this? Should i save the handler and
dialog state with "onRetainNonConfigurationInstance()"? If so, how to
do it properly and is it safe?

Or maybe my solution is wrong and I should create service, which
spawns the thread and communicates with activity (progress bar) with
AIDL?  But this will mean that the article in DevGuide is wrong, cause
it doesn't give a long term solution for creating a progress bar...

I'm stuck, and I'd appreciate all the response!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to