Null Pointer Exception while setting value of TextView in an Array Adapter class - Android

回眸只為那壹抹淺笑 提交于 2019-12-02 00:58:12

You already know where the problem is!

tv.setText(question.toString()+"");

is causing the NPE that means the TextView tv is null. And that means that the line

 TextView tv = (TextView) view.findViewById(R.id.question_list_item_string);

is not able to find the TextView. Check the question_list_item_string id and make sure it matches the id in your list_item_question.xml file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!