Android Dynamically load Listview at scroll end?

后端 未结 6 1929
梦毁少年i
梦毁少年i 2020-12-04 07:37

I am loading a listview from Http server, 20 at a time ,At the end of Listview I a want to load next 20 data from server and this process will continue till

6条回答
  •  一向
    一向 (楼主)
    2020-12-04 08:03

    I had this issue when I was accidentally trying to update a view from a non-ui thread. Pushing the ui update code to the ui thread resolved my issue!

    Handler mainHandler = new Handler(Looper.getMainLooper());
    mainHandler.post(new Runnable() {
        @Override
        public void run() {
                // insert ui update code here
            }
        }
    });
    

提交回复
热议问题