Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.

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

Public constructors

MutableContextWrapper(Context base)

Public methods

void setBaseContext(Context base)

Change the base context for this ContextWrapper.

Inherited methods

Public constructors

MutableContextWrapper

added in API level 1
public MutableContextWrapper (Context base)

Parameters
base Context

Public methods

setBaseContext

added in API level 1
public 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.