[Android] Implement Activity.onActivityResult

This commit is contained in:
Bettenbuk Zoltan 2018-08-09 15:25:17 +02:00 committed by Saúl Ibarra Corretgé
parent a327a5d804
commit 9fe2b834eb
2 changed files with 29 additions and 0 deletions

View File

@ -175,7 +175,12 @@ public class JitsiMeetActivity
if (Settings.canDrawOverlays(this)) {
initializeContentView();
}
return;
}
ReactActivityLifecycleCallbacks.onActivityResult(
this, requestCode, resultCode, data);
}
@Override

View File

@ -33,6 +33,30 @@ import com.facebook.react.modules.core.PermissionListener;
* it.
*/
public class ReactActivityLifecycleCallbacks {
/**
* {@link Activity} lifecycle method which should be called from
* {@code Activity#onActivityResult} so we are notified about results of external intents
* started/finished.
*
* @param activity {@code Activity} activity from where the result comes from.
* @param requestCode {@code int} code of the request.
* @param resultCode {@code int} code of the result.
* @param data {@code Intent} the intent of the activity.
*/
public static void onActivityResult(
Activity activity,
int requestCode,
int resultCode,
Intent data) {
ReactInstanceManager reactInstanceManager
= ReactInstanceManagerHolder.getReactInstanceManager();
if (reactInstanceManager != null) {
reactInstanceManager.onActivityResult(activity, requestCode, resultCode, data);
}
}
/**
* Needed for making sure this class working with the "PermissionsAndroid"
* React Native module.