@Override
public View getView(final int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
if(convertView == null){
LayoutInflater inflater=(LayoutInflater)c.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView=inflater.inflate(R.layout.program_list,null);
}
// GET VIEWS
TextView nameTxt=(TextView) convertView.findViewById(R.id.nametxt);
TextView landTxt=(TextView) convertView.findViewById(R.id.landtxt);
TextView groesseTxt=(TextView) convertView.findViewById(R.id.groessetxt);
TextView gewichtTxt=(TextView) convertView.findViewById(R.id.gewichttxt);
ImageView img =(ImageView) convertView.findViewById(R.id.imageView1);
//SET DATA
nameTxt.setText(names[position]);
landTxt.setText(land[position]);
groesseTxt.setText(groesse[position]);
gewichtTxt.setText(gewicht[position]);
img.setImageResource(images[position]);
return convertView;
}
I can't start my program of the NullPointerExceptionандроид TextView.setText NullPointer Exception (андроида новичок)
Я хочу, чтобы создать пользовательский элемент управления ListView, с OnClick на новую операцию ...
Один из этих 'nameTxt'' landTxt' 'groesseTxt'' gewichTxt' является нулевым – Bhargav
Какая строка выдает исключение? –
Проблема, вероятно, в том, что один из ваших массивов имеет значение null – victorantunes