ContextThemeWrapper

public class ContextThemeWrapper
extends ContextWrapper

java.lang.Object
   ↳ android.content.Context
     ↳ android.content.ContextWrapper
       ↳ androidx.appcompat.view.ContextThemeWrapper


A context wrapper that allows you to modify or replace the theme of the wrapped context.

Summary

Inherited constants

Public constructors

ContextThemeWrapper()

Creates a new context wrapper with no theme and no base context.

ContextThemeWrapper(Context base, int themeResId)

Creates a new context wrapper with the specified theme.

ContextThemeWrapper(Context base, Resources.Theme theme)

Creates a new context wrapper with the specified theme.

Public methods

void applyOverrideConfiguration(Configuration overrideConfiguration)

Call to set an "override configuration" on this context -- this is a configuration that replies one or more values of the standard configuration that is applied to the context.

AssetManager getAssets()
Resources getResources()
Object getSystemService(String name)
Resources.Theme getTheme()
int getThemeResId()

Returns the resource ID of the theme that is to be applied on top of the base context's theme.

void setTheme(int resid)

Protected methods

void attachBaseContext(Context newBase)
void onApplyThemeResource(Resources.Theme theme, int resid, boolean first)

Called by setTheme(int) and getTheme() to apply a theme resource to the current Theme object.

Inherited methods