class Adapter extends BaseAdapter {
private LayoutInflater mLayoutInflater;
public Adapter() {
mLayoutInflater = LayoutInflater.from(mContext);
}
public int getCount() {
return 0;
}
public Object getItem(int position) {
return null;
}
public long getItemId(int position) {
return 0;
}
public View getView(final int position, View convertView, ViewGroup parent) {
if(convertView == null) {
convertView = mLayoutInflater.inflate(R.layout., parent, false);
}
return convertView;
}
}
Android之BaseAdapter结构,拿来用原则
本文介绍了一个简单的自定义BaseAdapter实现案例,用于Android应用中ListView的数据绑定。该Adapter继承自BaseAdapter,并实现了必要的方法如getCount()、getItem()等。

被折叠的 条评论
为什么被折叠?



