NullPointerException in custom adapter getView

后端 未结 3 693
青春惊慌失措
青春惊慌失措 2020-12-18 04:12

I\'m coding a custom adapter for a ListView that has a custom list to it.

obviously, I have to write the getView function. so here is my code:



        
3条回答
  •  一向
    一向 (楼主)
    2020-12-18 04:33

    Try this

    vi = LayoutInflater.from(mActivity).inflate(R.layout.result_list_item, null);

    if mActivity is your Activity context passed from the activity where you are creating the object of this adapter.

提交回复
热议问题