|
@@ -17,6 +17,7 @@
|
17
|
17
|
|
18
|
18
|
package org.jitsi.meet.sdk;
|
19
|
19
|
|
|
20
|
+import android.app.Activity;
|
20
|
21
|
import android.app.Application;
|
21
|
22
|
import android.support.annotation.Nullable;
|
22
|
23
|
|
|
@@ -120,6 +121,18 @@ class ReactInstanceManagerHolder {
|
120
|
121
|
? reactContext.getNativeModule(nativeModuleClass) : null;
|
121
|
122
|
}
|
122
|
123
|
|
|
124
|
+ /**
|
|
125
|
+ * Gets the current {@link Activity} linked to React Native.
|
|
126
|
+ *
|
|
127
|
+ * @return An activity attached to React Native.
|
|
128
|
+ */
|
|
129
|
+ static Activity getCurrentActivity() {
|
|
130
|
+ ReactContext reactContext
|
|
131
|
+ = reactInstanceManager != null
|
|
132
|
+ ? reactInstanceManager.getCurrentReactContext() : null;
|
|
133
|
+ return reactContext != null ? reactContext.getCurrentActivity() : null;
|
|
134
|
+ }
|
|
135
|
+
|
123
|
136
|
static ReactInstanceManager getReactInstanceManager() {
|
124
|
137
|
return reactInstanceManager;
|
125
|
138
|
}
|