Am trying to implement chrisbane’s pull-to-refresh library for my ListView (https://github.com/chrisbanes/Android-PullToRefresh). It seems simple enough but what Im having trouble with is the fact it seems to require it’s own data set, seperate to what’s managed by your list adapter, i.e.
mListItems = new LinkedList<String>();
mListItems.addAll(Arrays.asList(mStrings));
All the examples I’ve seen just use this simple list of strings, but how do you go about using this with any kind of custom adapter, such as one that that contains a string and an imageview, etc?
There’re plenty of examples on this site and around.
You create your adapter and set this arraylist as a field there
or usually set as a constructor parameter.
You @override
getView()of this adapter and get your items usingpositionparameterin the
getView(). Here look at theOrderAdapterclass in this example:http://www.softwarepassion.com/android-series-custom-listview-items-and-adapters/
and here at the
GameAdapterclasshttp://jnastase.alner.net/archive/2010/12/19/custom-android-listadapter.aspx
hope this helps abit