1

can anyone tell me how can I use notifyDataSetChanged(); function when I want to refresh my arrylist in a activity when myadapter extends baseAdapter !!!

thanks a lot ...

Monerah
  • 215
  • 1
  • 5
  • 17

2 Answers2

2

when ever data of your array is changed you can call adapter.notifyDataSetChanged(); will refresh the data of your listview.

MAC
  • 15,799
  • 8
  • 54
  • 95
  • have been tried that and got this error: The method notifyDataSetChanged() is undefined for the type ListView !! – Monerah Apr 30 '12 at 14:23
  • I'm trying now .. if it works ill mark this answer .. thanks for ur quick response – Monerah Apr 30 '12 at 14:32
0

You need to add

lviewAdapter.notifyDataSetChanged();  

Here you can find details.

Check this

Community
  • 1
  • 1
Sandip Armal Patil
  • 6,241
  • 21
  • 93
  • 160