Of Code and Me

Somewhere to write down all the stuff I'm going to forget and then need

Setting child divider on an ExpandableListView causes weird flashing overlay on some Samsung phones November 29, 2011

Filed under: Android,Error — Rupert Bates @ 2:22 pm

This is a weird niche bug which I’m documenting here in case I need it in future.

Affected devices:
I have only seen it occur on a Samsung Galaxy S2 but I’m guessing it probably happens on any 2.x Samsung device running TouchWiz (it doesn’t happen on the Nexus S)

Steps to reproduce:
Create an activity with an ExpandableListView and set the childDivider property of the ExpandableListView to any colour, say red for ease of viewing


<ExpandableListView android:id="@+id/pageBundles"
                        android:layout_width="fill_parent"
                        android:layout_height="fill_parent"
                        android:childDivider="@color/red"
                        android:cacheColorHint="@color/white"/>

Now if you scroll the list for a while, particularly if you sort of wiggle it up and down quickly and then let it go the list will be completely covered by a solid block of the colour specified in the childDivider property. This will remain for a few seconds and then disappear.

To fix this issue just remove the childDivider property setting

About these ads
 

One Response to “Setting child divider on an ExpandableListView causes weird flashing overlay on some Samsung phones”

  1. Simon Says:

    Set android:cacheColorHint to transparent.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.