Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

setCacheColorHint on listfragments

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,

like image 503
fedepaol Avatar asked Nov 28 '11 20:11

fedepaol


1 Answers

You need to add getListView().setCacheColorHint(Color.TRANSPARENT) in onActivityCreated method instead onViewCreated

like image 129
denis.sugakov Avatar answered Oct 20 '22 23:10

denis.sugakov