Setting up async task for loading Json into a listview

前端 未结 5 1717
予麋鹿
予麋鹿 2020-12-09 23:22

I take json object generate from a PHP script on my server and then parse it into a listview using a lazy load for the images. The problem is that the json will load relativ

5条回答
  •  天命终不由人
    2020-12-09 23:35

    Here is a simple thread that will display an indeterminate ProgressDialog while you fetch your data and then dismiss itself once the thread is finished executing.

    ...
    final ProgressDialog pd = ProgessDialog.show(this, "some title", "some message", true);
    Thread t = new Thread(new Runnable(){
        @Override
        public void run(){
           //your code
           ....
    
           pd.dimiss();
        }
     });
     t.start();
     ...
    

提交回复
热议问题