this is my code when i implement get item count 1 it shows non static method cannot be reference when i implement count 2 it show null pointer exception on return statement helpme to fix this
final int speedScroll = 1000;
final Handler handler = new Handler();
final Runnable runnable = new Runnable() {
int count = 0;
@Override
public void run() {
if(count == Adapter4.getItemCount2())
count =0;
if(count < Adapter4.getItemCount2()){
recyclerView4.smoothScrollToPosition(++count);
handler.postDelayed(this,speedScroll);
}
}
};
handler.postDelayed(runnable,speedScroll);
}
@Override
public int getItemCount() {
return albumList.size();
}
public static int getItemCount2() {
List<Album4> albumList=null;
return albumList.size();
}