New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] modal cannot work if ReactRootView is created and cached in previous activity #9496

Closed
markzhai opened this Issue Aug 21, 2016 · 2 comments

Comments

Projects
None yet
3 participants
@markzhai

markzhai commented Aug 21, 2016

When I do pre-load of ReactRootView in previous Activity (in a hybrid app):

        ReactRootView rootView = new ReactRootView(activity);
        rootView.startReactApplication(
                ((ReactApplication) activity.getApplication()).getReactNativeHost().getReactInstanceManager(),
                reactInfo.getMainComponentName(),
                reactInfo.getLaunchOptions());

and later use the created view in ReactActivity directly

setContentView(mReactRootView);

Modal cannot show in this case then (works fine if I do not do this pre-load), I guess this is due to Android window issue as it is using the previous native activity to add window.

Any ideas on this? TimePickerAndroid works just fine.

react-native 0.31, Mac, Android.

@jokester

This comment has been minimized.

Show comment
Hide comment
@jokester

jokester Aug 22, 2016

Creating ReactRootView with a MutableContextWrapper might be a workaround (so we can change underlying Context in the 2nd Activity).

jokester commented Aug 22, 2016

Creating ReactRootView with a MutableContextWrapper might be a workaround (so we can change underlying Context in the 2nd Activity).

@markzhai

This comment has been minimized.

Show comment
Hide comment
@markzhai

markzhai Aug 22, 2016

@jokester it works, thanks

markzhai commented Aug 22, 2016

@jokester it works, thanks

@markzhai markzhai closed this Aug 22, 2016

@facebook facebook locked as resolved and limited conversation to collaborators May 24, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.