dimanche 28 février 2016

how to make sure that insert operation complete and the table has update?

Assume that there are 2 threads, one thread insert data to database via content provider. After the insert statement, callback a method to query the database in the anohter thread. However, some times it is possible that the query finished before the table has been update. So the new data can not been fetch.

Is there a method to make the insert operation really complete in android? Then calling the query method would return the new inserted data.

Aucun commentaire:

Enregistrer un commentaire