当我在一段时间后向下滚动列表时,我收到此错误。
我在$("button").click(function(){
$.ajax({
url: "demo_test.php",
data: $("input").val(),
type: "POST",
}});
});
中使用runOnUiThread()
完成了此操作,但它无效
下面doInBackground()
:
ScrollListener
listofcontests.setOnScrollListener(new AbsListView.OnScrollListener() {
@Override
public void onScroll(AbsListView view,
int firstVisibleItem, int visibleItemCount,
int totalItemCount) {
//Algorithm to check if the last item is visible or not
final int lastItem = firstVisibleItem + visibleItemCount;
final int totitem = Restotcnt-lastItem;
if (lastItem == totalItemCount && totalItemCount != 0 && Restotcnt-lastItem >= totresults) {
//if (totalItemCount - (firstVisibleItem + visibleItemCount) == SCROLL_OFFSET && totalItemCount != 0 && Restotcnt-lastItem >= totresults) {
// if (totalItemCount - (firstVisibleItem + 1 + visibleItemCount) < SCROLL_OFFSET &&
// visibleItemCount < totalItemCount) {
// // you have reached end of list, load more data
totcount = lastItem + 1;
limit = limit + totresults;
new LoadContestList1(getApplicationContext()).execute();
Log.d("limit=", limit + "-results=-" + totresults);
}
}
@Override
public void onScrollStateChanged(AbsListView view, int scrollState) {
}
});
方法:
postExecute