Intuitivly, I know, when it throws the IllegalStateException. But in my case, I can't, though, probably guess, where is trouble in the source. I dare say, trouble lines are there:
private class LoadMoreDataTask extends AsyncTask<Void, Void, Void> {
@Override
protected Void doInBackground(Void... params) {
if (isCancelled()) {
return null;
}
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
}
OFFSET = OFFSET + COUNT;
getWallsData();
return null;
}
@Override
protected void onPostExecute(Void result) {
mPostListAdapter.notifyDataSetChanged();
wallPostsList.onLoadMoreComplete();
super.onPostExecute(result);
}
@Override
protected void onCancelled() {
wallPostsList.onLoadMoreComplete();
}
there's a logcat message:
java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread. [in ListView(2131099757, class com.costum.android.widget.LoadMoreListView) with Adapter(class android.widget.HeaderViewListAdapter)]