0

I have a preference screen like this:

 <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
 >

    <CheckBoxPreference
        android:title = "Turn parrot on" 
        android:defaultValue="false"
        android:enabled="true"

        android:persistent="true"

        android:key="turning parrot" />
     <ListPreference
         android:key = "interval"
         android:title = "Talking interval"
         android:persistent="true"
         android:enabled="true"
         android:entries="@array/updateInterval"
         android:entryValues="@array/updateIntervalValues"
         android:dependency="turning parrot"
         android:defaultValue = "1"
         />

     <ListPreference
         android:key = "language"

         android:title = "Talking language"
         android:persistent="true"
         android:enabled="true"
         android:entries="@array/talkinglanguages"
         android:entryValues="@array/talkinglanguagesValues"
         android:dependency="turning parrot"
         android:defaultValue = "1"
         />

 </PreferenceScreen>

When I scroll the preference list, everything changes to white. If my list is a list view I should have done the following

listView = (ListView) this.findViewById(R.id.listview); 
listView.setCacheColorHint(Color.TRANSPARENT);

I learnt that from here

But my preference list does not have an id. How can I change the cache color to get rid of the white when scrolling.

Community
  • 1
  • 1
yasserbn
  • 391
  • 3
  • 18

1 Answers1

1

Preference screen is made of a standard ListView and has a default Android id list.

ListView listView = (ListView)findViewById(android.R.id.list);

Use that to set a cache color hint.

RufusInZen
  • 2,119
  • 1
  • 19
  • 26
  • I have a Screen within a screen. When on secondary screen it takes u to another screen which shows a list of ListPrefernces. How can I get its Id? – Muhammad Umar Jun 12 '13 at 09:50