0

The text in totalizador1TextView, do not change according with instruction, allways black. MIUI Global 14.0.13 Android 13TP1A

<?xml version="1.0" encoding="utf-8"?> <resources> <style name="MeuTema" parent="Theme.MaterialComponents.DayNight"> <item name="colorPrimary">@color/amarelo_torrado</item> <item name="colorPrimaryDark">@color/encarnado</item> <item name="colorAccent">@color/verde</item> <item name="textAllCaps">false</item> <item name="android:textAllCaps">false</item> <item name="android:forceDarkAllowed">false</item> </style> </resources>
protected void onCreate(Bundle savedInstanceState) { AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO); 
..... 
..... 
.....
totalizador1TextView.setTextColor(ContextCompat.getColor(this, R.color.amarelo)); 
Matt Morgan
5,3334 gold badges24 silver badges34 bronze badges
asked May 30, 2024 at 10:18

1 Answer 1

0

Try this one instead:

totalizador1TextView.setTextColor(getResources().getColor(R.color.amarelo,null))
answered May 30, 2024 at 11:56
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.