public class ReactInstanceManager
extends java.lang.Object
CatalystInstance. It expose a way to configure
catalyst instance using ReactPackage and keeps track of the lifecycle of that
instance. It also sets up connection between the instance and developers support functionality
of the framework.
An instance of this manager is required to start JS application in ReactRootView (see
ReactRootView.startReactApplication(com.facebook.react.ReactInstanceManager, java.lang.String) for more info).
The lifecycle of the instance of ReactInstanceManager should be bound to the activity
that owns the ReactRootView that is used to render react application using this
instance manager (see ReactRootView.startReactApplication(com.facebook.react.ReactInstanceManager, java.lang.String)). It's required to pass
owning activity's lifecycle events to the instance manager (see onPause(),
onDestroy() and onResume(com.facebook.react.modules.core.DefaultHardwareBackBtnHandler)).
To instantiate an instance of this class use builder().| Modifier and Type | Class and Description |
|---|---|
static class |
ReactInstanceManager.Builder
Builder class for
ReactInstanceManager |
| Modifier and Type | Method and Description |
|---|---|
static ReactInstanceManager.Builder |
builder()
Creates a builder that is capable of creating an instance of
ReactInstanceManager. |
ReactContext |
getCurrentReactContext() |
DevSupportManager |
getDevSupportManager() |
void |
onBackPressed()
This method will give JS the opportunity to consume the back button event.
|
void |
onDestroy() |
void |
onPause() |
void |
onResume(DefaultHardwareBackBtnHandler defaultBackButtonImpl)
Use this method when the activity resumes to enable invoking the back button directly from JS.
|
void |
showDevOptionsDialog() |
public DevSupportManager getDevSupportManager()
public static ReactInstanceManager.Builder builder()
ReactInstanceManager.public void onBackPressed()
public void onPause()
public void onResume(DefaultHardwareBackBtnHandler defaultBackButtonImpl)
ReactInstanceManager, so that once this instance receive onDestroy() event it will
clear the reference to that defaultBackButtonImpl.defaultBackButtonImpl - a DefaultHardwareBackBtnHandler from an Activity that owns
this instance of ReactInstanceManager.public void onDestroy()
public void showDevOptionsDialog()
@Nullable public ReactContext getCurrentReactContext()