MinSDKVersion = 7 TargetSDKVersion = 17
If the user have SDKVersion 11 or higher I like to set the theme to Theme.Holo.Light. It doesn't works for me here. When I launch the app on a 3.1 device it just uses the Theme.Light:
Same when I run this app on a device with lower version than 3.1
My Folderstructure:
Manifest:
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/MyTheme" >
values-v11:
<resources>
<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="@android:style/Theme.Light">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="@android:style/Theme.Light">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>
<style name="MyTheme" parent="@android:style/Theme.Holo.Light">
<!-- Any customizations for your app running on devices with Theme.Holo here -->
</style>
other values folders:
<resources>
<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="@android:style/Theme.Light">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="@android:style/Theme.Light">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>
<style name="MyTheme" parent="@android:style/Theme.Light">
<!-- Any customizations for your app running on devices with Theme.Holo here -->
</style>
How can I use this correctly?
Sincerely Marco Seiz
A style is a collection of attributes that specify the appearance for a single View . A style can specify attributes such as font color, font size, background color, and much more. A theme is a collection of attributes that's applied to an entire app, activity, or view hierarchy—not just an individual view.
Related. Rooted Android phones have access to custom themes that replace your home screen, notification and other system graphics. Themes need to be compatible with the specific Android-rooted ROM you currently have on the phone.
Open themes. xml (night) . In the Project pane select Android, go to app > res > values > themes > themes.
Why do you have your theme twice in your styles.xml file?
<style name="AppTheme" parent="@android:style/Theme.Light">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>
<style name="MyTheme" parent="@android:style/Theme.Holo.Light">
<!-- Any customizations for your app running on devices with Theme.Holo here -->
</style>
Delete the one you don't need(In this case the Theme.Light theme):
values-v11:
<style name="MyTheme" parent="@android:style/Theme.Holo.Light">
<!-- Any customizations for your app running on devices with Theme.Holo here -->
</style>
values:
<style name="MyTheme" parent="@android:style/Theme.Light">
<!-- Any customizations for your app running on devices with Theme.Holo here -->
</style>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With