It is necessary to constantly update the list of chats in the ListView and the user can constantly scroll through this list. Update doing in
private TimerTask timerTask = new TimerTask() { @Override public void run() { if(isLoading) return; arrayChat.clear(); loadChatList(((BaseActivity)getActivity()).login, ((BaseActivity)getActivity()).key, limit,0,""); } }; The whole problem is arrayChat.clear() . If the user is currently scrolling the list, then on this line an error IndexOutOfBoundsException: Index: 58, Size: 0 appears.
How can it be easier to beat if you do not make a function that will update the list without zeroing? Or not to do without this function?