I'm trying to set the contents of a ListView to an array of TextViews.
With what I have currently I get a Null Pointer Exception, even though I think I'd doing what is suggested here: how do I add items to listview dynamically in android
Here's what I have currently:
ListView lvSuggestions = (ListView)findViewById(R.id.lvSuggestions);
ArrayAdapter<TextView> arrayAdapter = new ArrayAdapter<TextView>(this, android.R.layout.simple_list_item_1);
lvSuggestions.setAdapter(arrayAdapter);
But I get the exception when it sets the adaptor.
I've tried filling the ArrayList with TextViews and then creating the Adaptor with the full ArrayList, but I get the same Null Pointer Exception when I set the Adaptor.
Thanks for any help