Which of the following two should I be using to make sure that all the cursors are closed?
Cursor c = getCursor(); if(c!=null && c.getCount()&g
I think my answer is the best one :
Cursor cursor = null; try { cursor = rsd.rawQuery(querySql, null); if (cursor.moveToFirst()) { do { // select your need data from database } while (cursor.moveToNext()); } } finally { if (cursor != null && !cursor.isClosed()) { cursor.close(); cursor = null; } }