can someone see what I have wrong with my cursor: The data from the db is not returned (at least the screen is blank). I think that is my problem. In the DDMS shows it ope
Cursor databaseCursor = null;
This is what you are passing to the adapter. Sure you are querying later, but you are never capturing the cursor result from that query, nor are you setting the cursor on the adapter. So since cursor is always null, you never have results.
Oh, you also need to keep the db open while your cursor is alive. Use the startManagingCursor method on the activity rather than close the database.
I think your problem is in
try {
db.rawQuery("SELECT * FROM AC_list", null);
} finally {
if (db != null)
Log.i("tag", "db closed");
db.close();
}
you are closing it as soon as you query and your query is never saved into databaseCursor, maybe what you wanted to do was:
try {
databaseCursor = db.rawQuery("SELECT * FROM AC_list", null);
} catch(Exception e) {
if (db != null)
Log.i("tag", "db closed");
db.close();
}
I hope this helps