I have multiple String arrays in my program (of which i have made individual adapters) on the click of a button i would like to make the listview refresh and display contents from one array (and hence switch to displaying contents of other arrays)
How do i achieve this?
seems from your question you have defined adapter for each string array, so when you want to refresh list view to load other string array just, set adapter for new string array, and your listview get updated automatically.
Like if you have String arrays to load data are:
Declare a temp String array to contain data source. say dataSource[].
In onCreate method of activity assign first array to datasource, by:
Declare your adapter as follows:
set This adapter to listView.
in onClick method of button change data source by:
and then call notifyDataSetChanged on adapter: