title: android database already close onResume
body: <p>my application has an issue where if I go back to an activity I get an error that the database has been closed:</p>
  
  <pre><code>ERROR/AndroidRuntime(3566): Caused by: java.lang.IllegalStateException: database /data/data/com.kempville.app/databases/MyDB already closed
  </code></pre>
  
  <p>I instantiate, open, instatiate a cursor, do the query, close the cursor and close the database all within a method called during onResume(). I don't know what is assumed to be open whenever onResume gets called when this activity comes back to the front.</p>
  
  <pre><code>private void getMydata() {
      MyDb db;
      db = new MyDB(this);
  db.open();
  Cursor c = db.getInfo(code);
  startManagingCursor(c);
  if (c.moveToFirst()) {
          name = c.getString(c.getColumnIndex("name"));
  }
  c = fdb.getType(myArray.getString("type"));
  startManagingCursor(c);
  if (c.moveToFirst()) {
      type = c.getString(c.getColumnIndex("type"));
  }
  c.close();
  db.close();
  </code></pre>