Android Question [solved] Starting app with dark mode

angel_

Well-Known Member
Licensed User
Longtime User
When I start the app the white screen appears while loading the views, how can I remove this effect or directly start the app with the dark mode?, is possible?

Code:
AddManifestText(
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="28"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.DarkTheme)

SetApplicationAttribute(android:theme, "@style/MyAppTheme")

CreateResource(values, MyAppTheme.xml,
<resources>
    <style name="MyAppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
    </style>
</resources>
)
 

Attachments

Make sure that your app appears as fast as possible. In most cases it should load fast enough that you don't need to worry about the base activity color.

If you are loading a large layout file then you can defer it by adding Sleep(50) before loading the layout.
I tried that but it appears like a flash, it is very very short but it is uncomfortable
 
Upvote 0
Upvote 0

Similar Threads

Back
Top