-1

I m using the base adapter with listview to display students picture with their name in my project. It's OK. But after that, I am using a Handler to update the picture dynamically when a student changes the picture from their apps. it is not working as desired.

The base adapter is getting data (ArrayList) from local SQLite DB and the SQLite is getting data from the server by AsyncTask in the handler. The first time it's displaying all the student's image and name very well but image update dynamically not working.

I am using notifyDataSetChanged method whenever the adapter's underlying data changes. I've tried SimpleAdapter, ArrayAdapter also but the problem persists. what should I do???

Regolith
  • 2,944
  • 9
  • 33
  • 50
Biltu
  • 1
  • 5

1 Answers1

0

You have used notifyDataSetChanged method for Base-adapter and Array Adapter But This method works like ,if your Adapter's data changed then it will update your View according to data. but if you update data inside database then it will not get any change and your view is not update so you need to reset your adapter for it.

Divyesh Kalotra
  • 204
  • 1
  • 2
  • 13
  • actually i am using a method everytime where adapter's referenced data is totally newly formed from database cursor after a data.clear(). everything is going perfect (I've checked by database query just before listview refresh) but notifyDatasetChanged() not refreshing the listview. – Biltu Nov 30 '17 at 11:18