java.lang.NullPointerException when try listview.getChildAt()

前端 未结 3 1364
猫巷女王i
猫巷女王i 2021-01-25 07:12

There is ListView with correct values:

public class FragmentTab1 extends SherlockFragment {

ListView list;
LazyAdapter adapter;

@Override
public void onViewCre         


        
3条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-25 08:07

    list.getChildAt(i) will be null if the child item is not visible. So check for null before use.

    So you cannot retrieve all checked items in this way.

    Please post complete .xml and the definition of .

提交回复
热议问题