String name = ((Map) list.get(position)).get("name").toString();老是报空指针异常,可能有哪些错误呢
我是想将数据库的数据列name显示在listview内,重写的baseadapter,在viewgetview:@OverridepublicViewgetView(in...
我是想将数据库的数据列name显示在listview内,重写的baseadapter,在view getview:
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View v = getLayoutInflater().inflate(R.layout.list_item, null);
(报错行)String name = ((Map) list.get(position)).get("name").toString();
TextView textview1 = (TextView) v.findViewById(R.id.text1);
textview1.setText(name);
return v;
}
不知道怎么解决?看logcat是空指针异常。。。求指教 展开
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View v = getLayoutInflater().inflate(R.layout.list_item, null);
(报错行)String name = ((Map) list.get(position)).get("name").toString();
TextView textview1 = (TextView) v.findViewById(R.id.text1);
textview1.setText(name);
return v;
}
不知道怎么解决?看logcat是空指针异常。。。求指教 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询