Android theme name from theme ID
Using packageInfo.applicationInfo.theme will return the theme for the entire app and not each activity. This is hacky, but should get the theme for the current activity/context: I know this is an old question, but...
Technical answers from my Stack Overflow history, with source links and licenses.
Showing 6 of 6 answers tagged themes
Exported May 9, 2026
Using packageInfo.applicationInfo.theme will return the theme for the entire app and not each activity. This is hacky, but should get the theme for the current activity/context: I know this is an old question, but...
So, what should I do to use a theme from different package resource? You shouldn't do this for many reasons. I wrote a simple project that shows that it is indeed possible as long as the package contains the resources...
You can change the EdgeEffect color of a ScrollView with some reflection:
Here is something better, IMHO, than the accepted answer. It is derived from this StackOverflow thread: Understanding the Use of ColorMatrix and ColorMatrixColorFilter to Modify a Drawable's Hue Example usage: Copy the...
This should work (did not test): attrs.xml styles.xml themes.xml
You would need to use the application's resources to load the theme. I have answered this in another thread here: https://stackoverflow.com/a/41948943/1048340 Here is an example where the package "com.example.theme" is...