I am using android compatibility library, and I am having some problems with listfragments using a non solid background. The issue is the same described on this link but calling setCacheColorHint on this.listView() does not have any effects. Does anybody have some idea about what’s going on?
<fragment class="com.mypackage.MyFragment"
android:id="@+id/my_fragment"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
and inside the fragment class, which happens to be a ListFragment, I have
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
getListView().setCacheColorHint(android.R.color.transparent);
super.onViewCreated(view, savedInstanceState);
}
Thanks,
You need to add
getListView().setCacheColorHint(Color.TRANSPARENT)inonActivityCreatedmethod insteadonViewCreated