Greetings yet again. I have an minor issue when taking a photo. I have a button that invokes the camera, successfully takes a photo, and returns to my entry form. My only problem is the database leak that occurs when pressing the button to call the camera. My code looks a little something like this.
public void takephoto(){
Intent in = new
Intent(this, takephoto.class);
startActivityForResult(in,1);
}
Here's a snippet of how the database is opened:
public journalDbAdapter open() throws SQLException {
mDbHelper = new DatabaseHelper(mCtx);
mDb = mDbHelper.getWritableDatabase();
return this;
}
public void close() {
mDbHelper.close();
}
I run :
mDbHelper = new journalDbAdapter(this);
mDbHelper.open();
In the onCreate of the Activity or Class that I am calling the camera in. I have not coded in mDbHelper.close(); anywhere not sure if i should when or where. I think i would rather just leave it open while capturing one image.
Logcat:
08-17 21:33:37.582: ERROR/Database(18297): java.lang.IllegalStateException: /data/data/com.growjournal.beta/databases/grower SQLiteDatabase created and never closed 08-17 21:33:37.582: ERROR/Database(18297): at android.database.sqlite.SQLiteDatabase.(SQLiteDatabase.java:1785)
What possible problems could I face if this was never fixed??
Everything seems to be working fine, but i would defiantly like to avoid any issues amongst the many android devices out there.