Error getCount() java.lang.NullPointerException
Hi, have an error when run app. It's rise "java.lang.NullPointerException: Attempt to invoke virtual method 'int androidx.viewpager.widget.PagerAdapter.getCount()' on a null object reference at com.smarteist.autoimageslider.SliderView$2.run(SliderView.java:397)..."
Hi, have an error when run app. It's rise "java.lang.NullPointerException: Attempt to invoke virtual method 'int androidx.viewpager.widget.PagerAdapter.getCount()' on a null object reference at com.smarteist.autoimageslider.SliderView$2.run(SliderView.java:397)..."
always call notifyDataSetChanged() method when adapter data is changed.
Hi, thanks for your response. But, it's still not work. It's rise more errors. "java.lang.NullPointerException: Attempt to invoke virtual method 'void adapter.notifyDataSetChanged()' on a null object reference" in updateView
Hi, thanks for your response. But, it's still not work. It's rise more errors. "java.lang.NullPointerException: Attempt to invoke virtual method 'void adapter.notifyDataSetChanged()' on a null object reference" in updateView
Because the slider adapter is null there. first set adapter to sliderview then update your views.
Yep, i'm set adapter in initView, and notifyDataSetChanged in updateView. But, it's still rise errors
done. It worked for me. Thanks so much