Achanta wrote:
> Can anyone suggest a work around for this issue.
> I have a background thread which starts in the onCreate methos and
> which I close in the onDestroy method. But because of this bug in the
> sdk 2.1 my thread never stops. But when the user closes the
> app[onDestroy hasn't been called] and opens my application again, I
> try to create the thread in the onCreate. But after this is done at
> some point the onDestroy from the earlier activity is called which
> sends a messahe to my thread's handler to stop the thread. So the app
> runs now but the background thread doesnot run.

You may be able to redesign your application to not require a permanent
background thread. For example, use discrete AsyncTasks that do some
work and end.

> Another problem that I face with the same issue is since the handle
> passes the message to stop the thread even while it is supposed to
> run, my events trigger actions where i have to write to database from
> the background thread. Now since that is null it shows the force close
> message.

I have no idea what this means.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android Training in US: 14-18 June 2010: http://bignerdranch.com

-- 
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