When a new data row is inserted in my sqlite database, I want to query the same row (not whole database) so that I can reflect this in my complex list view.
Currently I am using content observer to observe any change in my database but I don’t know how I can query the only row which was previously inserted. Also onChange method of ContentObserver does not provide any information other than change in database.
How can we do this? Any idea?
When you insert a row into your sqlite database, you normally use
db.insert(), and the return value from that function is the ID of the newly inserted row (if you have a _id column asprimary keyandauto_increment).You can (and should) use that for your need.