Posts holo themes with backward compatibility
Post
Cancel

holo themes with backward compatibility

references http://www.chilisapps.com/blog/2012/04/17/support-holo-and-older-themes-in-android/ http://stackoverflow.com/questions/9681648/how-to-use-holo-light-theme-and-fall-back-to-light-on-pre-honeycomb-devices http://developer.android.com/about/dashboards/index.html

Many times we would like to support SDK 2.x till 9.x

1
    <uses-sdk android:minsdkversion="8" android:targetsdkversion="16"></uses-sdk>

what about when SDK >= 3 use the holo theme and when < 3=”” use=”” the=”” black=”” one?=”” alright,=”” lets=”” create=”” custom=”” themes!=”” thanks=”” aracem=”” values/themes.xml=”” -=””>(Android 2.0+)

1
2
3
4
5
6
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="MyAppTheme" parent="@android:style/Theme.Light.NoTitleBar">
        <!-- Any customizations for your app running on pre-3.0 devices here -->
    </style>
</resources> 

values-v11/themes.xml - (Android 3.0+)

1
2
3
4
5
6
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="MyAppTheme" parent="@android:style/Theme.Holo.Light">

    </style>
</resources>

values-v14/themes.xml - (Android 4.0+)

1
2
3
4
5
6
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="MyAppTheme" parent="@android:style/Theme.DeviceDefault.Light.NoActionBar">

    </style>
</resources>

manifest js <application ...="" android:theme="@style/MyAppTheme"> </application>

origin - http://www.pipiscrew.com/?p=1187 android-holo-themes-with-backward-compatibility

This post is licensed under CC BY 4.0 by the author.
Contents

Trending Tags