Consider this preferences.xml file:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/preference_main">
<PreferenceScreen
android:title="@string/preference_sight"
android:key="category_sight">
<ListPreference
android:summary="@string/preference_sight_wb_msg"
android:title="@string/preference_sight_wb_title"
android:key="sight_wb" android:defaultValue="auto"/>
<Preference
android:key="sight_wb_values_cache"/>
<eu.elevelcbt.sm.preferences.PercentBarPreference
android:title="@string/preference_sight_mean_confidence_min_title"
android:summary="@string/preference_sight_mean_confidence_min_msg"
android:key="sight_mean_confidence_min"
android:defaultValue="80"/>
<CheckBoxPreference
android:key="sight_flash"
android:defaultValue="false"
android:summary="@string/preference_sight_flash_msg"
android:title="@string/preference_sight_flash_title"/>
</PreferenceScreen>
</PreferenceScreen>
When shown in my MainPreference class extending PreferenceActivity is correctly shows me a first level menu with one entry "Sight" (@string/preference_main) which, when selected, takes me to the second preference screen where I have all my preferences. Everything works as I wanted. The only thing is the on first preference screen I want to put an icon beside the label "Sight" like in main Android setting menu.
How can I do that? Thank you very much in advance for any help! Luca.
Mine:
Desired:
...mmm I tried but no luck...
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/preference_main">
<PreferenceScreen
android:title="@string/preference_sight"
android:key="category_sight"
android:icon="@drawable/ic_dialog_light">
...
</PreferenceScreen>
where am I doing wrong?