Back to project page RobolectricSample.
The source code is released under:
MIT License
If you think the Android project RobolectricSample listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.pivotallabs; //from ww w. jav a 2s .c o m import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import java.util.List; public abstract class GenericAdapter<T> extends BaseAdapter { private List<T> list; public GenericAdapter(List<T> list) { this.list = list; } @Override public int getCount() { return list.size(); } @Override public T getItem(int i) { return list.get(i); } @Override public long getItemId(int i) { return i; } @Override public View getView(int position, View convertView, ViewGroup parent) { return getView(getItem(position), convertView, parent); } abstract public View getView(T item, View recycleView, ViewGroup parent); }