Set a theme on a View programmatically on Android 5.0 Lollipop
Android 5.0 Lollipop added the ability to set a theme for different views (not just the Activity). android:theme="@style/MyAwesomeTheme" Is there a way to set the theme on a view dynamically? android:theme changes specific attributes specified in the theme resource. You could instantiate specific view using any overloaded constructor, like View(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) . which basically is what inflater does. For example v7.widget.Toolbar tries to create themed context out of resource android:theme right in the super call of the constructor, which