0

I am creating and managing listView using BaseAdapetr. In each list view item I have to display an image which is being downloading background theard. On successful download sending listner to the UI to refresh the image for all list items.

I tryied out ListView's invalidate() and invalidateViews() function in UI to referesh complete list but no luck. I tried out with BaseAdapetr's notifyDataSetChanged() and still not able to referesh the list items.

What will be the way to refresh all list view items?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Android_IT
  • 396
  • 2
  • 5
  • 24
  • 2
    It depends on your BaseAdapter implementation, can you post your code ? We needs to see how you handle your items – Plumillon Forge Aug 30 '12 at 13:20
  • because `BaseAdapter` does not set any `DataSetObserver` ... so derive your Adapter implementation from more concrete Adapter (like ArrayAdapter or CursorAdapter)... – Selvin Aug 30 '12 at 13:21
  • check this posts http://stackoverflow.com/a/9872804/760489, http://stackoverflow.com/a/9402052/760489, http://stackoverflow.com/a/7219767/760489 – Pratik Aug 30 '12 at 13:38

2 Answers2

0

Define a BaseAdapter again for new list and then set a list using setListAdapter

0

Update or setadapter your listview when your data changes like the below code. you just have to change the values of your arraylist prior before using the below code that you want to update after refresh.

   adapter = new AlertsDetailAdapter(this,ParseAlertsDetailInfo.InvoiceNumber,ParseAlertsDetailInfo.Supplier,ParseAlertsDetailInfo.Value);
    listview.setAdapter(adapter);

Hope it will Help you out to solve your problem

Bhavesh Patadiya
  • 25,740
  • 15
  • 81
  • 107