Right so let's say my adapter looks like this, and by default I always
have 5 cows to render, and 0 horses to render. Cows and Horses each
require a different view type:
public class MyAdapter extends BaseAdapter {
ArrayListHorse mHorses;
ArrayListCow mCows;
public MyAdapter() {
Mark Wyszomierski wrote:
@Override
public int getViewTypeCount() {
int count = 0;
if (mHorses.size() 0 {
count++;
}
if (mCows.size() 0) {
count+;
}
return count;
}
Just return 2 from getViewTypeCount().
What do you think you're gaining from
In that example, nothing, but if I have an adapter which can accept an
unknown amount of types, I would need something like that, right?
Thanks
On Mar 2, 11:42 am, Mark Murphy mmur...@commonsware.com wrote:
Mark Wyszomierski wrote:
@Override
public int getViewTypeCount() {
int
Mark Wyszomierski wrote:
In that example, nothing, but if I have an adapter which can accept an
unknown amount of types, I would need something like that, right?
You can't have an unknown amount of types. You can't even have a
variable-at-runtime amount of types.
--
Mark Murphy (a Commons
4 matches
Mail list logo