mercredi 11 février 2015

notifyDataSetChanged in a listfragment does nothing

I have a listfragment with an adapter define like this :



ArrayAdapter<String> aa;
ArrayList<String> arrayList = new ArrayList<String>();

aa = new ArrayAdapter<String>(getActivity(),
android.R.layout.simple_list_item_1, arrayList);
setListAdapter(aa);


I 'm using this to add item to my list from an sqlite database



arrayList.add


the problem is that notify data has change does nothing (i m deleting element from the sqlite so i need to refresh the content of the arraylist)


i'm doing this :



aa.notifyDataSetChanged();

Aucun commentaire:

Enregistrer un commentaire