Saturday, 10 August 2013

ListView update after any change

ListView update after any change

I have a listview in my android app which does two functions with the
listview itself.
Fist, I can delete an item from the listview.
Second, I can rename something in the listview.
Anytime any of the above happens,
How do I display a different XML layout if the last item on the listview
is deleted?
adapter = new SetRowsCustomAdapter(getActivity(), R.layout.customlist,
rowsArray);
dataList = (ListView) mFrame3.findViewById(R.id.lvFiles); //lvfiles from
xml layout
dataList.setAdapter(adapter);
dataList.setEmptyView(noFilesDisplayed); //not working
Second, once I rename anything within the listview, how do I update the
listview to reflect the changes?
adapter.notifyDataSetChanged(); //not working

No comments:

Post a Comment