Thank you Mark,

Yes I am trying to redesign it to use AsyncTask. One reason why I did
not take this approach is that I just wanted a plain thread that sits
and logs user events that are occurring throughout my app and it made
more sense to just start that thread when the app starts and shut it
down when the app closes. I had a handler which grabs the logs and
puts them in db and the thread just sits there and logs them to
server.

I saw the google tracker but the apis for analytics are not yet good
enough to provide us all the data which we can integrate into our
marketing tools.

I still hope this issue will be resolved soon.

On Mar 11, 2:26 pm, Mark Murphy <mmur...@commonsware.com> wrote:
> 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