public class AppStateModule extends ReactContextBaseJavaModule implements LifecycleEventListener
BaseJavaModule.JavaMethod, BaseJavaModule.SyncJavaHook
NativeModule.NativeMethod, NativeModule.SyncNativeHook
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
APP_STATE_ACTIVE |
static java.lang.String |
APP_STATE_BACKGROUND |
METHOD_TYPE_ASYNC, METHOD_TYPE_PROMISE, METHOD_TYPE_SYNC
Constructor and Description |
---|
AppStateModule(ReactApplicationContext reactContext) |
Modifier and Type | Method and Description |
---|---|
void |
getCurrentAppState(Callback success,
Callback error) |
java.lang.String |
getName() |
void |
initialize()
This is called at the end of
CatalystApplicationFragment#createCatalystInstance()
after the CatalystInstance has been created, in order to initialize NativeModules that require
the CatalystInstance or JS modules. |
void |
onHostDestroy()
Called when host activity receives destroy event (e.g.
|
void |
onHostPause()
Called when host activity receives pause event (e.g.
|
void |
onHostResume()
Called when host activity receives resume event (e.g.
|
getCurrentActivity, getReactApplicationContext
canOverrideExistingModule, getConstants, getMethods, getSyncHooks, onCatalystInstanceDestroy, onReactBridgeInitialized, supportsWebWorkers, writeConstantsField
public static final java.lang.String APP_STATE_ACTIVE
public static final java.lang.String APP_STATE_BACKGROUND
public AppStateModule(ReactApplicationContext reactContext)
public java.lang.String getName()
getName
in interface NativeModule
require()
this module
from javascript.public void initialize()
NativeModule
CatalystApplicationFragment#createCatalystInstance()
after the CatalystInstance has been created, in order to initialize NativeModules that require
the CatalystInstance or JS modules.initialize
in interface NativeModule
initialize
in class BaseJavaModule
public void onHostResume()
LifecycleEventListener
Activity#onResume
. Always called
for the most current activity.onHostResume
in interface LifecycleEventListener
public void onHostPause()
LifecycleEventListener
Activity#onPause
. Always called
for the most current activity.onHostPause
in interface LifecycleEventListener
public void onHostDestroy()
LifecycleEventListener
Activity#onDestroy
. Only called
for the last React activity to be destroyed.onHostDestroy
in interface LifecycleEventListener