hi Friends,
i have been using a SQLite database, Theres a situation where i have a list which displays all the "name" field data of a table "table1". Now i have a button to insert data in "table1". The list is populated using a simple cursor adapter which is passed a cursor "cursor1" populated with the data. "cursor1" is prepared using the SQLite query - "SELECT * FROM table1". Now the moment i insert data, i need to update the list too.
My question is-
- will the Adapter sense the database change automatically (i guess not)?
- using
cursor1.requery()
is correct or should i usecursor1 = db.query("table1", null, null, null, null, null, null);
It would be helpful if you can throw some light on which 1 is better and in which situation. Coz for the situation which i explained above, the requery()
command is not giving a valid result while the later 1 works fine. still cant understand what the problem could be.