废话不说,先粘贴出我写的基类
/**
* Adapter基类
*
* @author 智江鹏
* @version 1.0
*/
public abstract class Base_Z_Adapter extends android.widget.BaseAdapter {
/**
* 数据存储集合
**/
public List<Object> mDataList = new ArrayList<Object>();
/**
* Context上下文
**/
/**
* 日志输出标志
**/
protected final String TAG = this.getClass().getSimpleName();
public Base_Z_Adapter() {
}
@Override
public int getCount() {
Log.e("777","77"+ mDataList.size());
return mDataList.size();
}
@Override
public Object getItem(int position) {
if (position < mDataList.size())
return mDataList.get(position);
else
return null;
}
@Override
public long getItemId(int position) {
return position;
}
/**
* 添加数据
*/
public boolean addItem(Object object) {
return mDataList.a