Skip to content

Most visited

Recently visited

navigation

MutableContextWrapper

public class MutableContextWrapper
extends ContextWrapper

java.lang.Object
   ↳ android.content.Context
     ↳ android.content.ContextWrapper
       ↳ android.content.MutableContextWrapper


Special version of ContextWrapper that allows the base context to be modified after it is initially set.

Summary

Inherited constants

From class android.content.Context

Public constructors

MutableContextWrapper(Context base)

Public methods

void setBaseContext(Context base)

Change the base context for this ContextWrapper.

Inherited methods

From class android.content.ContextWrapper
From class android.content.Context
From class java.lang.Object

Public constructors

MutableContextWrapper

added in API level 1
MutableContextWrapper (Context base)

Parameters
base Context

Public methods

setBaseContext

added in API level 1
void setBaseContext (Context base)

Change the base context for this ContextWrapper. All calls will then be delegated to the base context. Unlike ContextWrapper, the base context can be changed even after one is already set.

Parameters
base Context: The new base context for this wrapper.

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (Dec 2017 Android Platform & Tools Survey)