Skip to content Skip to sidebar Skip to footer

Listview Doesn't Get Styled With Theme When Using Custom Adapter

I have minidemo with three fragments. One displays two TextView and an editview directly, the next treat the same layout as rows in a list with custom adapter, the third displays a

Solution 1:

Instead of using getApplicationContext(), use getBaseContext() or getContext()

More here : Theme/Style is not applied when inflater used with ApplicationContext

Solution 2:

Arghh, I just found the answer, with a hint from Use android.R.layout.simple_list_item_1 with a light theme

The trick is to remove getActivityContext() and to pass in the activity object directly when creating the adapter. Sad but effective.

Post a Comment for "Listview Doesn't Get Styled With Theme When Using Custom Adapter"