clearCachesForTheme

Clears cached values associated with the specified Theme.

This method allows developers to work around issues related to stale cached resources that may occur on API level 32 and below following a call to applyStyle. If you are not explicitly calling applyStyle in your code, you probably do not need to call this method.

Starting in Android T, the Theme class correctly implements hashCode and cached values will be appropriately cleared when the contents of a Theme object change.

Parameters

theme

the theme for which associated values should be cleared from the resource cache