Android is showing a blank screen before it loads all components from layout. What could be the solution for this ?
Asked
Active
Viewed 256 times
1
-
Use a less resource intensive layout – Raghav Sood Jun 07 '13 at 07:58
-
What would you like it to show? – fweigl Jun 07 '13 at 08:05
-
1This may be not only an issue with layout, but also an issue with what else are you doing inside `onCreate()` or even, `onStart()` and `onResume()` methods. – S.D. Jun 07 '13 at 08:09
2 Answers
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
-
Ya, I guess Progressbar is a good option rather than removing the important components in layout – user1223035 Jun 11 '13 at 05:24
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