Android: listview: custom items: nullpointerexception, findviewbyid returns null

前端 未结 5 2237
耶瑟儿~
耶瑟儿~ 2020-12-11 14:27

I have been googling and searching to resolve this error for some time and I can`t seem to find out why and how to solve it.

I`m using a customAdapter to fill in my

5条回答
  •  爱一瞬间的悲伤
    2020-12-11 14:52

    Search for the views in the convertView that you inflate(and not in the current Activity layout like you currently do):

     mHolder.textViewCenter = (TextView) 
                    convertView.findViewById(R.id.textview_list_item_central);
    

提交回复
热议问题