Search code examples
androidtabsloader

Tab loading screen - Android


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 have 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?


Solution

  • 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