|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object android.content.Context android.content.ContextWrapper mobi.voiceassistant.base.content.StableContext
public final class StableContext
Special ContextWrapper
which is tolerant to device configuration changes
Application.onConfigurationChanged(android.content.res.Configuration)
,
Service.onConfigurationChanged(android.content.res.Configuration)
,
Activity.onConfigurationChanged(android.content.res.Configuration)
,
R.attr.configChanges
Field Summary |
---|
Method Summary | |
---|---|
static Context |
createConfigurationContext(Context base,
Configuration overrideConfig)
Same as createStableContext(android.content.Context) but with overriden configuration. |
static Context |
createDefaultLocaleContext(Context base)
Same as createStableContext(android.content.Context) but locale is not taken from base
but from Locale.getDefault() (which means device's default locale). |
static Context |
createDisplayContext(Context base,
Display overrideDisplay)
Same as createStableContext(android.content.Context) but with overriden configuration. |
static Context |
createLocaleContext(Context base,
Locale locale)
Same as createStableContext(android.content.Context) but with overriden locale. |
static Context |
createStableContext(Context base)
|
Resources |
getBaseResources()
|
Resources |
getResources()
|
Methods inherited from class android.content.Context |
---|
getString, getString, getText, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, registerComponentCallbacks, unregisterComponentCallbacks |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public Resources getResources()
getResources
in class ContextWrapper
Context.getResources()
public Resources getBaseResources()
Context.getResources()
public static Context createStableContext(Context base)
base
- Base context
StableContext
backed by base
with resources tolerant to configuration changes
NullPointerException
- if base
is null
ContextWrapper.ContextWrapper(Context)
public static Context createDefaultLocaleContext(Context base)
createStableContext(android.content.Context)
but locale is not taken from base
but from Locale.getDefault()
(which means device's default locale).
base
- Base context
NullPointerException
- if base
is null
Locale.getDefault()
,
createStableContext(android.content.Context)
,
createLocaleContext(android.content.Context, java.util.Locale)
public static Context createLocaleContext(Context base, Locale locale)
createStableContext(android.content.Context)
but with overriden locale.
base
- Base contextlocale
- Specific locale or null
for locale from base
NullPointerException
- if base
is null
createStableContext(android.content.Context)
public static Context createConfigurationContext(Context base, Configuration overrideConfig)
createStableContext(android.content.Context)
but with overriden configuration.
base
- Base contextoverrideConfig
- Specific configuration or null
for configuration from base
NullPointerException
- if base
is null
createStableContext(android.content.Context)
public static Context createDisplayContext(Context base, Display overrideDisplay)
createStableContext(android.content.Context)
but with overriden configuration.
base
- Base contextoverrideDisplay
- Specific display or null
for display from base
NullPointerException
- if base
is null
createStableContext(android.content.Context)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |