'Why value defined in `values.xml` gets overriden?

I have clean Android project initialized from AndroidStudio. I am trying to change style of actionMenuItem so it is not in uppercase.

I found out that there is an abc_config_actionMenuItemAllCaps boolean set in \appcompat-1.4.1\res\values\values.xml.

I tried to override it by this values.xml file:

<resources>
    <bool name="abc_config_actionMenuItemAllCaps">false</bool>
</resources>

but it does not work.

I am not trying to find a solution for having actionMenuItem lowercase. I am trying to get reasoning behind why overriding the boolean is not working.



Solution 1:[1]

It's because library gets the value from its values file not from your app's values.xml. For instance:
You get some boolean value using:

getResources().getBoolean(com.yourapps.package.R.bool.some_id);

but library uses:

getResources().getBoolean(com.library.package.R.bool.some_id);

As you can see paths are different, so it is simply impossible to override in this way.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jan Rozenbajgier