Android: text color holo light

后端 未结 2 1519
-上瘾入骨i
-上瘾入骨i 2021-01-05 20:13

I just have a stupid question... I am using (or better, I suppose to use) the theme holo light in my application: I have set it in the manifest file. Look at the screenshot

2条回答
  •  失恋的感觉
    2021-01-05 20:54

    When you create your Adapter, are you using the application context or the activity? I just ran into the exact same problem but noticed if I generated my Array Adapter like this:

    ArrayAdapter listAdapter = new ArrayAdapter(getApplicationContext(),
                        android.R.layout.simple_list_item_1, tables);
                setListAdapter(listAdapter);
    

    Then the text was appearing white. If, however, I used the activity context (so if I was doing the above in the onCreate method, I could just use "this") the text was black. I think somehow my app was overriding the theme. Perhaps that is / was your issue as well?

提交回复
热议问题