Other Problem with background color of views (EditText, Spin)

uskomp

Member
Licensed User
Longtime User
Hi.
I made upgrade B4A from version 4 to 6.80 and I have problem with background of views (EditText and Spin).
Color of background in version 4 was white, now is navy blue.
I can't change it in designer or with code as
B4X:
EditText1.Color = Colors.White
Initializing with code below change not color of background.
B4X:
EditText1.Initialize("ET")
.......
Sub ET_Initialize
    Dim et As EditText
    et = Sender
    et.Color = Colors.White
End Sub
Any solution?

Edit: Problem exists still with this code too
B4X:
 Dim cdw As  ColorDrawable
    cdw.Initialize(Colors.White,1dip)
    et.Background = cdw
 
Last edited:

Mahares

Expert
Licensed User
Longtime User
You can still use it if you like by setting the targetSdkVersion to 8 (in the manifest editor).
But you always recommend against using an old OS or API as you may encounter problems with newer devices.
What do you recommend for someone to use for a theme that will provide colors similar to using the old theme, such as nicely seen backgrounds and make the TargetSDK as high as 25. When I use targetSDK 10, I get the best and clearest backgrounds of all views. But, I do not want to get stuck with the obsolescence of older OS versions.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
You are correct. I do recommend to avoid using the old Android 2 theme. The main reason is that your app will look outdated. The issues with newer devices are less common.
BTW, don't set the targetSdkVersion to 25. Set it to 19 or 23 if you want to deal with runtime permissions.

If you like the old theme then you should use it.
 
Upvote 0

Pendrush

Well-Known Member
Licensed User
Longtime User
I have already published app with targetSdkVersion set to 25.
Is there any reason not to set targetSdkVersion to 25 but 23?
 
Upvote 0

uskomp

Member
Licensed User
Longtime User
I had in manifest file targetSdkVersion = 19 and colors were fatally.
I set targetSdkVersion to 8 - OK.
Thanks for fast help.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Is there any reason not to set targetSdkVersion to 25 but 23?
If you have tested your app carefully with an Android 7.1 device then it is fine.
For example there are more restrictions on the ability to share files if the targetSdkVersion 24+.

You don't really gain anything at this point from setting the target to 25 instead of 23.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…