view.setBackgroundColor(android.R.color.transparent);
should be view.setBackgroundResource (android.R.color.transparent) reason setBackgroundColor accepts a hex color value as a parameter.
or
android:cacheColorHint = "#00000000"
use this tag for your list. or you can also use
listview.setCacheColorHint()
to install it programmatically.
From Why is my list black? Android optimization in the Android developers blog:
To fix this problem, all you have to do is either turn off hint optimization for the cache color if you are using a non-solid background color, or set the hint to the appropriate solid color value. It can be a dome from code, or preferably from XML, using the android: cacheColorHint attribute. To turn off optimization, just use the transparent color # 00000000. The following screenshot shows a list with android: cacheColorHint = "# 00000000" set in the XML layout file:
Padma kumar
source share