0

I am very new to Android development. I am little confuse about the use of Adapter.notifyDataSetChanged() with ArrayAdapter and ListView. In my project, I am displaying all student in ListView with the help of an ArrayAdapter. The ArrayAdapter is getting the data (ArrayList) from local(Sqlite) database. further, the local database is getting the data from server whenever the server data is changed.

I created the adapter instance in onCreate() and I bound the Listview with it. Whenever the local database is changed, I am trying to refresh the ListView with notifyDataSetChanged() method but somehow its not working.

halfer
  • 19,824
  • 17
  • 99
  • 186
Biltu
  • 1
  • 5
  • 6
    Put the code :) – diegoveloper Nov 20 '17 at 13:15
  • How are you loading the data from the database into the `ArrayAdapter`? You'll need to post the code for that at least before anyone can help you. – Leo Aso Nov 20 '17 at 13:29
  • You should see this -> https://stackoverflow.com/questions/12229817/android-how-does-notifydatasetchanged-method-and-listviews-work –  Nov 20 '17 at 13:29
  • I have come to know that Array Adapter does not responses to notifyDataSetChanged() except, adapter.add() or adapter.remove() is used. But unfortunately there is no update method of array adapter. So, in my project updation of student data is not reflecting to ListView dynamically. what should i do??? – Biltu Nov 20 '17 at 16:12

0 Answers0