Hi Jay, no you just have to call the closing mechanism once. Normally during the onDestroy() event of last Activity that remains on the system. This is normally the launcher Activity.
@Override protected void onDestroy() { Log.d(TAG, "onDestroy fired!"); dbhelper.close(); super.onDestroy(); } regards Michael On Jun 21, 11:29 am, Jay XU <jaytraveler...@gmail.com> wrote: > Hi, > > I am new to Android and I am looking at the Notepad Tutorial sample code > now. In the NotesDbAdapter class, it defines a close() method to close the > DatabaseHelper. However I cannot find this method get called anywhere. > > So my question is when shall we close the DB connection. I suppose we should > call it in the onDestroy() mehod of each Activity class. Or will Android > framework will take care of this so we don't have to worry about it? > > Please advise. thanks. > > -Jay -- 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