That doesn't work if the launching activity has been removed from the task (e.g. because Android needs more memory). With your approach the db would be closed and the other activities had no db access any more (the other activities could still be running). Instead of spreading the db access code across all activities I would strongly vote for Dianne's singleton approach.
Emanuel Moecklin On Apr 7, 3:26 pm, lbendlin <[email protected]> wrote: > I close the databases in the onDestroy() of the launcher activity. I also > include code in other activities and services to check if the databases have > been closed, and then prevent these lenient lurkers from trying to access > them. -- 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

