Android Question AppCompat: ACSwitch color problem?

Hi all!

In the app I am developing the ACSwitches seem to behave a little strange.
As you can see in the example project attached, I load a layout that has some switches in it.
The problem is that the first switch always starts with a white color, while the others get their colors from the application theme that I defined in the manifest (as I suppose it should be their normal behavior).
If you try to reload the same layout a second time, this issue disappear.

Am I making some weird mistake that I'm not aware of? Or am I using the AppCompat library in the wrong way?
Any ideas, thoughts?

Thanks all.


    13.1 KB · Views: 215
Actually I figured out what was the issue there.

I forgot to add the specific line of code for the AppCompat library to work properly (as explained here):

In my example project (and also in my main project) I only used the code
that was a leftover of me trying to change the CheckBoxes and EditTexts color ( -

Now I am using both lines and the problem never occurred again.
Upvote 0