Android ListView update with SimpleCursorAdapter?

I had a similar issue where I could not get my list to update, and what I did was just create a refreshListView() method. Now you can call this initially from your onCreate(), AND anytime a user adds something to the DB. All it does is re-bind the listview to a cursor.

With all the deprecating methods (requery()), and issues with notifyDataSetChanged(), I decided this was the easiest way.

Just to mention: 'requery()' is already deprecated. Documentation has a clear record on this. – 87element Nov 21 at 14:31 I know, I didn't quite word that sentence right, re-worded it :> – Jack Nov 21 at 14:34 Jack thanks for your reply, I see that I forget to say the above code is my populate() function I call it in my onCreate() method and if I click the "Add"-Button.

I only wanted to know whether this is a good solution to call this method instead of calling the common notifyDataSetChanged() method of the base adapter class. – Siggy Petersen Nov 21 at 14:37 Oh I see, it is too early and I have not had my coffee yet. Yes that should be fine, I've been using it for awhile now and it works great.

– Jack Nov 21 at 14:40 Hehe...ok no problem sometimes I have the same problem without coffee or red bull and in fact it was my false. But thanks for your help. – Siggy Petersen Nov 21 at 14:41.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions