Question

I put a button in a listview item, the onclicklistener was set in the getView() method of the adpter. The adapter is an individual class file extends BaseAdapter. And by the onclick event of the button, the data set of the listview is changed, how can I refresh the listview in the adapter?

I can not call adpter.notifyDataSetChanged() method in the getView() method of the adapter.

And now I am using broadcast to notify the listview in ***Activity.class. However, I dont think it is a good idea. Then, how to make it?

Was it helpful?

Solution

Can you add something like

AdapterClass.this.notifyDataSetchanged()

to your onClickListener within the getView() method?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top