获取列表大小为 46。我得到了 constrator 中的所有值。getView 没有调用,
我的代码如下,
public class Atom_1_Adapter extends BaseAdapter {
private Activity activity;
List<MsgStandard> msgList1=new ArrayList<MsgStandard>();
private LayoutInflater inflater=null;
ImageLoader imageLoader;
int size=0;
String tag="Atom_1_Adapter";
public Atom_1_Adapter(Activity activity, List<MsgStandard> msgList1) {
this.activity = activity;
this.msgList1 = msgList1
size=this.msgList1.size();
inflater = (LayoutInflater)this.activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
imageLoader=new ImageLoader(activity);
}
@Override
public int getCount() {
return size;
}
@Override
public Object getItem(int position) {
return position;
}
@Override
public long getItemId(int position) {
return position;
}
class ViewHolder{
ImageView image1,image2;
}
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
System.out.println("enter get view--->>>>>>");
View vi=convertView;
ViewHolder holder=new ViewHolder();
try{
vi=inflater.inflate(R.layout.homepagelist_1_adapter,null);
//here my layout declaration
vi.setTag(holder);
//here set value for TextView,ImageView... etc
return vi;
}catch{}
}
}
谢谢,