views:

1012

answers:

2

I want to refresh an Android ListView after adding/deleting dynamic data.

Can any one tell me how to achieve this?

+2  A: 

Call notifyDataSetChanged() on your Adapter.

Christopher
A: 

Hi UMMA,

if you are not still satisfied with ListView Refreshment, you can look at this snippet,this is for loading the listView from DB, Actually what you have to do is simply reload the ListView,after you perform any CRUD Operation Its not a best way to code, but it will refresh the ListView as you wish..

It works for Me....if u find better solution,please Share...

.......
......
do your CRUD Operations..
......
.....
DBAdapter.open();
DBAdapter.insert_into_SingleList();
// Bring that DB_results and add it to list as its contents....
                                            ls2.setAdapter(new ArrayAdapter(DynTABSample.this,
    android.R.layout.simple_list_item_1,                        DBAdapter.DB_ListView));
                                            DBAdapter.close();
Nandagopal T
I found a better solution! It's right above yours.
Elijah
HI Umma, if possible, please let me know....your style ..Thanks
Nandagopal T