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 ...

0

2 Answers 2

2

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

Sign up to request clarification or add additional context in comments.

2 Comments

have been tried that and got this error: The method notifyDataSetChanged() is undefined for the type ListView !!
I'm trying now .. if it works ill mark this answer .. thanks for ur quick response
0

You need to add

lviewAdapter.notifyDataSetChanged();  

Here you can find details.

Check this

5 Comments

have been tried that and got this error: The method notifyDataSetChanged() is undefined for the type ListView !!
have you extend ListActivity class.?
try this ((BaseAdapter) lview.getAdapter()).notifyDataSetChanged();
I tried it before but it didn't work .. i'm trying now with other solution thanks for ur quick response

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.