How to have a loading screen while data is being loaded on android?
<p>I am trying to understand how to load a screen while all my methods and data is completely done loading. I noticed apps like Gmail, instagram, etc. have a little loading icon in the middle over white while the screen fully loads, and some of my data takes a while to load so I was wondering how I can have the screen in the meanwhile show a loading screen instead of flashing the data noticeably when it is ready.</p>

<p>One thought I had was surrounding the whole view in a relative layout and on load keep the layout within the relative layout visible and then switching to the other view... I do not know if that is the smartest way but let me know if there is another more efficient method. I will need this to be used for every screen as it makes a call to the servers - pre-cache, also some screens do not cache the data since it makes no sense.</p>

<p>Let me know if there are any easy libs or a modular technique I can implement outside of my xml layout plan.</p>