mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
ReactActivity extends FragmentActivity (#22662)
Summary: In https://github.com/facebook/react-native/pull/20602, I tried to make ReactActivity to extend AppCompatActivity per Google recommendation. But import failed, now ReactActivity extends FragmentActivity which is a parent class of AppCompatActivity and step forward to extend AppCompatActivity. Pull Request resolved: https://github.com/facebook/react-native/pull/22662 Reviewed By: mdvacca Differential Revision: D13505140 Pulled By: hramos fbshipit-source-id: d4edc8dc5c606c45811c1deddf5727a47ad484d8
This commit is contained in:
committed by
Facebook Github Bot
parent
5ee738659b
commit
dda2b82a0a
@@ -11,7 +11,6 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.FragmentActivity;
|
||||
import android.view.KeyEvent;
|
||||
|
||||
import com.facebook.infer.annotation.Assertions;
|
||||
@@ -30,7 +29,6 @@ import javax.annotation.Nullable;
|
||||
public class ReactActivityDelegate {
|
||||
|
||||
private final @Nullable Activity mActivity;
|
||||
private final @Nullable FragmentActivity mFragmentActivity;
|
||||
private final @Nullable String mMainComponentName;
|
||||
|
||||
private @Nullable ReactRootView mReactRootView;
|
||||
@@ -38,18 +36,15 @@ public class ReactActivityDelegate {
|
||||
private @Nullable PermissionListener mPermissionListener;
|
||||
private @Nullable Callback mPermissionsCallback;
|
||||
|
||||
@Deprecated
|
||||
public ReactActivityDelegate(Activity activity, @Nullable String mainComponentName) {
|
||||
mActivity = activity;
|
||||
mMainComponentName = mainComponentName;
|
||||
mFragmentActivity = null;
|
||||
}
|
||||
|
||||
public ReactActivityDelegate(
|
||||
FragmentActivity fragmentActivity,
|
||||
@Nullable String mainComponentName) {
|
||||
mFragmentActivity = fragmentActivity;
|
||||
public ReactActivityDelegate(ReactActivity activity, @Nullable String mainComponentName) {
|
||||
mActivity = activity;
|
||||
mMainComponentName = mainComponentName;
|
||||
mActivity = null;
|
||||
}
|
||||
|
||||
protected @Nullable Bundle getLaunchOptions() {
|
||||
@@ -206,10 +201,7 @@ public class ReactActivityDelegate {
|
||||
}
|
||||
|
||||
protected Context getContext() {
|
||||
if (mActivity != null) {
|
||||
return mActivity;
|
||||
}
|
||||
return Assertions.assertNotNull(mFragmentActivity);
|
||||
return Assertions.assertNotNull(mActivity);
|
||||
}
|
||||
|
||||
protected Activity getPlainActivity() {
|
||||
|
||||
Reference in New Issue
Block a user