Another problem related to this one. When the secondary thread post back to the main thread, the main thread fetches data from the DB and update the view. Here also I got an error. It is perfectly normal since the application has been killed. How to handle that?
Thanks a lot in advance. On Jan 21, 2:45 pm, polo777 <polodr...@yahoo.com> wrote: > Hi everyone, > > I have two threads: > - the main one in charge of the UI > - a second one that takes care of network calls, parsing responses and > database updates. > > The main threads open the database, retrieves information into a > Cursor that is used to feed a listView. > > My problem is the following: When I close the application the activity > is destroyed, the second thread can still be running and thereby still > can update the DB. Since the main thread open the DB, I want to close > it to do the stuffs properly. > > However if I close it within the onDestroy method and if the second > thread is running and is about to update the DB, I get an error. > > What is the best way to handle this situation? > > Thanks a lot > Polo --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---