android - Set initial background color before loading -
how can set background color of activity before setcontentview
. have activity takes lot of time load, need keep background white until activity finishes loading.
i guess need.
first define color in values/colors.xml
<resources> <color name="background">#ffffff </color> </resources>
create themes.xml file in res/values references color:
<resources> <style name="mytheme" parent="@android:style/theme.light"> <item name="android:windowbackground">@color/background</item> </style> </resources>
... , in androidmanifest.xml specify theme activity use.
<activity android:name=".myactivity" android:theme="@style/mytheme" />
Comments
Post a Comment