How to display a “Loading…” text while retrieving items for a ListView

后端 未结 3 942
无人共我
无人共我 2021-02-08 12:33

There are some others applications doing this, like Twitter, Facebook, or even native applications such as Android Market. When you want to display a list of items retrieved fro

3条回答
  •  再見小時候
    2021-02-08 12:59

    I don't know whether it will completely fits your requirement, simple way is just set the loading text initially to android-empty-id-view like

     
    

    and if no list items found then set android-empty-id-view to different message in async callback

    ((TextView) findViewById(android.R.id.empty)).setText("Your List is empty");
    

    it will give enough indication to user that something is progressing..i.e list is loading

提交回复
热议问题