Setting Android Background & Persistence Menu Bar – Using attribute on older versions causes crash – Is there a theme /pattern approach?

Styles are your friend….

Have two values directories, one is values-v11, the other the default values.

Each values directory contains a styles.xml, the difference being that the default values one contains;

<style name="listViewActivatedStyle"/>

The values-v11 contains;

<style name="listViewActivatedStyle">
   <item name="android:background">?android:attr/activatedBackgroundIndicator</item>
</style>

Then you can have a single layout which uses;

style="@style/listViewActivatedStyle"

and the appropriate one is selected.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)