Android Question EditText has black text on black background in Android 4.1 & 4.3

rayzrocket

Member
Licensed User
Longtime User
B4A 3.5 in use. The Default EditText box looks fine in API14 (Droid 4.0.1, Galaxy 2 Skyrocket) with white background and black text. (see the droid2.jpg attached)

But when I run an App on Android 4.1(Galaxy 3) or Android 4.3 (Moto X), the EditText box has black background and black text making it difficult to see the text. (see the droid1.jpg attached)

I tested on hard devices(by downloading the app from Google Play) and virtual devices on my PC.

Has anyone encountered this issue?
What is the best way to resolve this?

Thanks in advance,...
 

Attachments

  • driod1.jpg
    driod1.jpg
    20.8 KB · Views: 210
  • driod2.jpg
    driod2.jpg
    21.5 KB · Views: 177

rayzrocket

Member
Licensed User
Longtime User
Thanks Luca. Adding the SetApplicationAttribute fixes the issue as Erel suggested.
But, I must be doing something wrong by using default B4A EditText for Android 4.1 & 4.3 appearing black on black.

Do I need to set the EditText background?

B4X:
SetApplicationAttribute(android:theme, "@android:style/Theme")
 
Upvote 0

rayzrocket

Member
Licensed User
Longtime User
Yes, Setting Text color to default fixes the visual contrast issue.
See the pictures below, one uses default values for CheckBox and EditText without setting 'SetApplicationAttribute' (Blue dot bar).
The other uses Black text in EditText and uses the 'SetApplicationAttribute' to force the 'old school' Droid look (Yellow Bar).
IMO, the 'old school' looks a bit more user friendly, clear, and shows the user it's a mutatable/changeable field.
driod3.jpg
driod4.jpg
 
Upvote 0
Top