I've never used a cursor with an adapter, but in general, when your adapter changes you need to call notifyDataSetChanged() on your adapter to let it know that the data needs to be refreshed... The adapter will then tell the listview it needs to update itself.
Also, you shouldn't have to set the adapter on the listview when you swap out the data... just call notifyDataSetChanged(). Thanks, Justin Anderson MagouyaWare Developer http://sites.google.com/site/magouyaware On Fri, Oct 19, 2012 at 10:43 AM, Jacek Jabłoński <[email protected]>wrote: > Hi, > > I have problem in my app. I have CursorLoader in conjcution with > CursorAdapter. Everything works as expected, except one condition: when I > have some items on ListView and I swap cursor in adapter for cursor that is > empty, visible items aren't deleted (only dividers between rows disappear). > When I touch ListView it disappears instantly. > > Here is the situation. I have some non empty cursor: > > http://i.stack.imgur.com/VhvEb.png > > Then I swap for cursor that has no results: > > http://i.stack.imgur.com/uT6pP.png > > > > > > As you can see only dividers disappeard. After touching the screen both > items disappear. > > Source of my fragment class: http://pastebin.com/N2YGzgRj > > Please help me to solve this problem, because I have no idea what is > causing it. > > Greetings, > > Jacek Jabłoński > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

