Take a look at the method onRetainNonConfigurationInstance() of the
Activity class. :-)

http://developer.android.com/reference/android/app/Activity.html#onRetainNonConfigurationInstance()

On May 27, 2:01 pm, Robert Green <[email protected]> wrote:
> I have an app that communicates with a server.  While it is
> communicating, it shows a progress dialog.  The way this actually
> works is that I have a class that I call my NetworkGateway.  Each
> method takes a Handler as a callback so that the gateway can send back
> the response as a bundle when it has finished.
>
> Right now when someone changes orientation while a network operation
> is occuring, the activity doesn't know that a thread is running the
> network code and then the callback might be invalid.
>
> What's the right way to do this?  I want to make it so that after the
> orientation switch, the activity can check something to see if a
> network operation is running and if so, display the progress dialog
> again and wait for the callback, or set itself as the callback handler
> now, invalidating the old one.
>
> My first guess is that this is exactly the kind of thing services were
> designed for, but I'd like specifics if anyone can supply them.
>
> Thanks!
--~--~---------~--~----~------------~-------~--~----~
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