I\'m looking into writing a custom adapter to populate a listview with 3 textviews per line. I\'ve found quite a bit of example code to do this, but the one that seemed the
I'm a beginner also so take this answer with a pinch of salt - if it doesn't work, move on and Google some more. Not familiar with AdapterView
since I traditionally have a ListView
or GridView
and a custom Adapter extended off a BaseAdapter
and then listView.setAdapter(myCustomAdapter)
.
You could try making something like this inside the WeatherAdapter
class:
public void addToList(Weather mWeather) {
weatherList.add(mWeather);
}
Then in the class that calls WeatherAdapter
:
weatherAdapter.addToList(weatherToAdd);
weatherAdapter.notifyDataSetChanged();
Also you need to optimize it more in the getView method:
http://www.youtube.com/watch?v=wDBM6wVEO70