From 0bcd01e5c4c45068cdedbd3ede071283a77eb894 Mon Sep 17 00:00:00 2001 From: Martin Konicek Date: Sat, 7 Nov 2015 14:14:24 +0100 Subject: [PATCH] Update EmbeddedAppAndroid.md --- docs/EmbeddedAppAndroid.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/EmbeddedAppAndroid.md b/docs/EmbeddedAppAndroid.md index 573834e27ee..27a0bfddb1c 100644 --- a/docs/EmbeddedAppAndroid.md +++ b/docs/EmbeddedAppAndroid.md @@ -167,3 +167,7 @@ To run your app, you need to first start the development server. To do this, sim Now build and run your Android app as normal (e.g. `./gradlew installDebug`). Once you reach your React-powered activity inside the app, it should load the JavaScript code from the development server and display: ![Screenshot](/react-native/img/EmbeddedAppAndroid.png) + +## Sharing a ReactInstance across multiple Activities / Fragments in your app + +You can have multiple Activities or Fragments that use the same `ReactInstanceManager`. You'll want to make your own "ReactFragment" or "ReactActivity" and have a singleton "holder" that holds a `ReactInstanceManager`. When you need the `ReactInstanceManager` / hook up the `ReactInstanceManager` to the lifecycle of those Activities or Fragments, use the one provided by the singleton.