abdojobs / androidedinburghbustracker

Automatically exported from code.google.com/p/androidedinburghbustracker
0 stars 0 forks source link

java.lang.IllegalStateException: /data/data/uk.org.rivernile.edinburghbustracker.android/databases/settings.db SQLiteDatabase created and never closed #1

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
When the application is run on the emulator or an actual device, the 
following exception is spotted in the ddms tool:

java.lang.IllegalStateException: 
/data/data/uk.org.rivernile.edinburghbustracker.android/databases/settings.
db SQLiteDatabase created and never closed
...
at 
uk.org.rivernile.edinburghbustracker.android.SettingsDatabase.getAllFavouri
teStops(SettingsDatabase.java:81)
at 
uk.org.rivernile.edinburghbustracker.android.FavouriteStopsActivity.onCreat
e(FavouriteStopsActivity.java:69)
...

Find a way to close the connection to the SQLite database while still 
allowing the Cursor object to be used.

Original issue reported on code.google.com by riverni...@gmail.com on 2 Feb 2010 at 1:01

GoogleCodeExporter commented 8 years ago
Fixed in revision 25. Instead of classes being able to create their own 
instances of 
the SettingsDatabase class, the class is now responsible for its own creation 
by 
limiting it to 1 instance at a time. I have done some initial testing and there 
are no 
exceptions coming up in the Android ddms tool relating to this.

Original comment by riverni...@gmail.com on 13 Feb 2010 at 12:38