dynamic lazylist

后端 未结 3 1071
甜味超标
甜味超标 2021-01-23 12:51

Hello everyone i want to make this Lazylist dynamic . i have tried with images first buts its coming with force to close . Please guide if my approach is wrong. Here is code

3条回答
  •  迷失自我
    2021-01-23 13:30

    Your NullPointer Exception is in getCount() line 27:

    Caused by: java.lang.NullPointerException
    at com.droidnova.android.howto.optionmenu.LazyAdapter.getCount(LazyAdapter.java:27)
    

    You could fix the sympton by changing getCount() to:

    public int getCount() {
        if(data != null){
            return data.length;
        }
        return 0;
    }
    

提交回复
热议问题