Arun C S
Arun C S

Reputation: 3

Change of Data in a ListView in Android

I have a list view populated with some data.I need to change the data in the listview on click of a button.now the problem is the data associated with the adapter is getting changed but the same is not getting changed in the ui. but when i change the orientation from landscape to portrait,the new data is getting displayed.Can anybody suggest a solution for this.

Thanks in advance.

Upvotes: 0

Views: 79

Answers (1)

laalto
laalto

Reputation: 152817

Call notifyDataSetChanged() on your ListAdapter.

When changing orientation it probably works because by default on orientation change, your activity gets destroyed and recreated, also recreating the list adapter.

Upvotes: 2

Related Questions