public class AppStateModule extends ReactContextBaseJavaModule implements LifecycleEventListener
NativeModule.NativeMethod| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
APP_STATE_ACTIVE |
static java.lang.String |
APP_STATE_BACKGROUND |
METHOD_TYPE_REMOTE, METHOD_TYPE_REMOTE_ASYNC| 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/service) receives destroy event (e.g.
|
void |
onHostPause()
Called when host (activity/service) receives pause event (e.g.
|
void |
onHostResume()
Called when host (activity/service) receives resume event (e.g.
|
getCurrentActivity, getReactApplicationContextcanOverrideExistingModule, getConstants, getMethods, onCatalystInstanceDestroy, writeConstantsFieldpublic 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 NativeModulerequire() this module
from javascript.public void initialize()
NativeModuleCatalystApplicationFragment#createCatalystInstance()
after the CatalystInstance has been created, in order to initialize NativeModules that require
the CatalystInstance or JS modules.initialize in interface NativeModuleinitialize in class BaseJavaModulepublic void onHostResume()
LifecycleEventListenerActivity#onResumeonHostResume in interface LifecycleEventListenerpublic void onHostPause()
LifecycleEventListenerActivity#onPauseonHostPause in interface LifecycleEventListenerpublic void onHostDestroy()
LifecycleEventListenerActivity#onDestroyonHostDestroy in interface LifecycleEventListener