You're passing as the ListView
's row the layout that you used for the activity content(the one containing the wifi ListView
) and also passing in the to
array the id(R.id.listView_wifi
) of the ListView
. This will fail because the adapter can't bind data to a ListView
from the row directly and what you're trying to do is incorrect anyway.
You'd want to make a different layout to use in the SimpleAdapter
to which to bind the data. One simple solution, as you're planing to bind a String to the row, is to use this:
adapter = new SimpleAdapter(
this,
arraylist,
android.R.layout.simple_list_item_1,
new String[] { ITEM_KEY },
new int[] { android.R.id.text1 });