Learning Android™ Application Programming: A Hands-On Guide to Building Android Applications
by James Talbot, Justin McLean, Jorge Hernandez
Changing Themes
As well as dimming the screen, you can use a different theme that reverses the black text to white text on black, which can be easier on the eye in dim light.
Depending on which version of Android the application is running, it may be using a different theme. On Android API level 14 and later, it’s using Theme.Halo.Light.DarkActionBar; on API level 11 and later, it’s using Theme.Halo.Light; and under API level 11, it’s using Theme.Light. This is defined in the values/style.xml files you have already looked at. Each of these themes has a corresponding reversed (or dark) theme.
For a theme to be applied, it must be set before the view is inflated. This means that it must come before the call to setContentView. You must restart your ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access