Hi

I have a Activity class, a Thread class. The activity object creates
the thread object and starts the thread. I can communicate with the
thread via Handler class. The thread is running and doing some simple
data fetching thru web.

Question/Issue.

If I press the back button on the Activity dialog, activity is gone;
the thread is still running and I like it that way. When I restart the
activity (by clicking on the app icon), how do I restore the
communication with the running thread?
I am not comfortable with the 2 solutions I know: 1) I don't want the
thread class be a singleton. 2) static member variable in activity to
hold the thread object.

Is there any other cleaner way to do this? I would like the thread
object be gone once I am done with this thread; making it singleton,
static, I don't know when it gets destroyed.

Any suggestion is appreciated.

Thank you
Jacob

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to