You can call notifyDataSetChanged() on the Adapter of your ListView, or set a new Adapter for your ListView somewhere else in code.
Please also have a look at this post for specific information:
Android: how to refresh ListView contents?
Taken from the post above:
// this could be inside your oncreate method:
ListView lv = (ListView) findViewById(R.id.listView1);
lv.setAdapter(defaultAdapter); // the defaultAdapter is the ListAdapter you first added to the listview, its a member-variable
// this will refresh the adapter and therefore refresh the listView
public void refreshListViewContent() {
List<Item> newItems = getNewListViewItems(); // get the new listview items from somewhere
defaultAdapter.clear(); // clear your adapter
defaultAdapter.addAll(newItems); // add the new items
defaultAdapter.notifyDataSetChanged(); // do the actual refresh
}
The method refreshListViewContent() can be called from anywhere in your code, for example when you click a Button or something like that:
Button button = (Button) findViewById(R.id.btn1);
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
refreshListViewContent();
}
});