开发者

Tab loading screen - Android

开发者 https://www.devze.com 2023-02-24 19:40 出处:网络
I have 5 Tabs and on 2 of theme there is a content provided from our server. There is about 170 items in ListVie in each of tabs. To download and process data it can take about 1 second (or more - dep

I have 5 Tabs and on 2 of theme there is a content provided from our server. There is about 170 items in ListVie in each of tabs. To download and process data it can take about 1 second (or more - depend on signal strength)...

Let me be more exact... I ha开发者_如何学Gove 5 tabs (tab1, tab2, tab3, tab4, tab5). First two (tab1 and tab2) receives content from servers. When I click from whatever tab to tab1 or tab2 it takes time to switch and looks like app freezes. Therefore I would like to create a loader... How to do that in tabs?


This may well help Android: Showing indeterminate progress bar in TabHost activity


You need to fire off a new thread in Android when loading data from the background. You can use a progress bar notification would also provide user feedback but using multiple threads will allow your UI to remain active and provide a better user experience. There is a good guide in the Android documentation: Painless Threading

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号