我有一个自定义对象(NewsFeedObj)的数组列表。我想使用 NewsFeedObj 中的变量填充列表视图。当我运行代码时,我得到一个空白屏幕。怎么了?
class Sadapter extends ArrayAdapter<NewsFeedObj>
{
Context context;
int j;
NewsFeedObj o = new NewsFeedObj();
ArrayList<NewsFeedObj> l;
public Sadapter(Context context,int i,ArrayList<NewsFeedObj> g)
{
super(context,i,g);
this.context=context;
this.l=g;
this.j=i;
// TODO Auto-generated constructor stub
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View row=inflater.inflate(R.layout.newfeed_layout,parent,false);
//row.findViewById(id)
TextView Text=(TextView) row.findViewById(R.id.Description);
o=l.get(position);
Text.setText( o.get_description());
return row;
}
}