質問

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?

役に立ちましたか?

解決

Can you add something like

AdapterClass.this.notifyDataSetchanged()

to your onClickListener within the getView() method?

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top