I have an app which is using a black background. I've been developing and testing it on Lollipop, yet minSDK is 19. When I use a KitKat device (or emulator), I run into a problem with the white text I see on my Lollipop device - it is black and thus invisible.
I define the text color like this:
<TextView
android:id="@+id/list_header_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="6dp"
android:text="27.02.2016"
android:textColor="@color/text_primary"
android:textSize="16dp"/>
Then, in (all) my styles.xml I have the following theme defined:
<style name="AppTheme.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:textColorPrimary">@color/text_primary</item>
<item name="android:background">@color/colorPrimary</item>
</style>
In colors.xml, text_primary
is defined like this:
<color name="text_primary">#FFFFFF</color>
Once again, on Lollipop I can see the text in pure perfect white, yet on KitKat it appears black. Where did I go wrong? In my opinion, since the TextView
textcolor is defined explicitly to be text_primary
it should work on across all SDK versions?!