title: Addressing "Releasing statement in a finalizer. Please ensure that you explicitly call close() on your cursor"
body: <p>I have two DB clsses, one copies the db file from assets to the phone.</p>
  
  <p>the Second is where I have been putting my DB calls but in the log I am getting an awrful lot error about I should close the cursor. This I am getting confused about as all my calls have a cursor.close() on the end.</p>
  
  <p>Code of second:</p>
  
  <pre><code>public class DatabaseTools extends Common {
  
  
      private Context context;
      private SQLiteDatabase db;
      private DatabaseHelper dbHelper;
      private Cursor cursor;
  
      public DatabaseTools(Context context) {
          this.context = context;
          dbHelper = new DatabaseHelper(context);
          db = dbHelper.getWritableDatabase();
      }
  
      //  MARKS
      public ArrayList&lt;String&gt; getNames(String value) {
                  Names = new ArrayList&lt;String&gt;();
  
                  selectStatement = new String[] { DB_COMMON_COL_NAME };
                  fromStatement = DB_COMMON_COL_VALUE + " = '" + value + "'";
  
              cursor = db.query(
                  DB_DISTANCE_TABLE_NAME, 
                  selectStatement, 
                  fromStatement, 
                  null, 
                  null, 
                  null, 
                  null);
  
          int distanceIndex = cursor.getColumnIndex(DB_COMMON_COL_NAME);
  
          if (cursor.moveToFirst()) {
              do {                
                  distanceNames.add(cursor.getString(distanceIndex));
  
              } while (cursor.moveToNext());
          }
          cursor.close();
  
          return names;
  
      }
  </code></pre>