1

Android is showing a blank screen before it loads all components from layout. What could be the solution for this ?

OcuS
  • 5,320
  • 3
  • 36
  • 45
user1223035
  • 241
  • 2
  • 21

2 Answers2

0

In my opinion, the first option should be trying to remove some components from your layout. If that's not an option I'd act depending on how much time that blank screen is shown.

If the screen is shown less than 1 second I wouldn't mind. Otherwise, I'd show a ProgressBar or something like that and, when all the components are loaded, replace that ProgressBar with the loaded layout. To know if a component has been loaded you can use ViewTreeObserver (How can you tell when a layout has been drawn?).

Community
  • 1
  • 1
PX Developer
  • 8,065
  • 7
  • 42
  • 66
0

if you used nested linear/relative layout, this might slow A LOT the rendering of your view. also, if you have a lot of image to load, or if you call an asynctask, it will slow the rendering as well

wazaminator
  • 245
  • 3
  • 15