0

After setting SeekBar with Holo style, I got warning that it's not supported pre-Holo APIs.

If I leave it this way, will this crash the app or pull pre-Holo style anyway? It does not crash on the emulator and I don't have 2.3.3 device.

The reason for asking his is odd behaviour. I tried to manually set style for Holo and pre-Holo using res/values-v11/ directories and placing styles.xml in each and setting the style of SeekBar to style="@style/settings_seekbar" .

Style for API 11+ looked like this

<style name="settings_seekbar">
    <item name="android:seekBarStyle">@android:style/Widget.Holo.SeekBar</item>
</style>

and style for APIs older than 11 looked like this

<style name="settings_seekbar">
    <item name="android:seekBarStyle">@android:style/Widget.SeekBar</item>
</style>

So it looked like this would work. But on either device with Android 4.0+, I don't see Holo's theme, but the old thick-yellow theme.

If this is the proper way of settings styles (in case the first solution will crash a device), where did I make a mistake thus Holo theme never appeared on newer devices?

sandalone
  • 41,141
  • 63
  • 222
  • 338

1 Answers1

0

It seems we can safely use a theme from the upper SDK because I found no indicators that it will ever crash the app.

If the theme does not exist, Android will use the appropriate lower-level theme.

The error we can see on the image is just a warning that UI will not look the same in the SDKs which do not support this theme.

sandalone
  • 41,141
  • 63
  • 222
  • 338