import android.content.Context; import android.widget.BaseAdapter; import java.util.List; /** * 基类Adapter * Created by Administrator on 2015/10/22 0022. */ public abstract class MyBaseAdapter<T> extends BaseAdapter { protected Context mContext; public List<T> datas; public MyBaseAdapter(BaseActivity context,List<T> list) { super(); mContext = context; datas = list; } public MyBaseAdapter(BaseActivity context) { super(); mContext = context; } @Override public int getCount() { try { return datas.size(); } catch (Exception e) { } return 0; } @Override public Object getItem(int position) { return datas.get(position); } @Override public long getItemId(int position) { return position; } }