Skip to content
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

How can one get support fragment manager from ThemedReactContext ? #21194

Closed
akdsouza opened this issue Sep 19, 2018 · 5 comments
Closed

How can one get support fragment manager from ThemedReactContext ? #21194

akdsouza opened this issue Sep 19, 2018 · 5 comments
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@akdsouza
Copy link

I'm writing a custom native android library that exposes a support fragment for display. I created a simple view manager on the android side of react in which I return a placeholder layout in createViewInstance and later intend to add the library fragment inside receiveCommand on user action from the react side. However in order to add the fragment to the aforementioned container I cannot get the support fragment manager from the ThemedReactContext obj that I capture in createViewInstance. Doing fooThemedReactContext.getCurrentActivity() yields the deprecated android.app.FragmentManager. How do I get android.support.v4.app.FragmentManager instead in my view manager?

@react-native-bot
Copy link
Collaborator

We are automatically closing this issue because it does not appear to follow any of the provided issue templates.

Please make use of the bug report template to let us know about a reproducible bug or regression in the core React Native library.

If you'd like to propose a change or discuss a feature request, there is a repository dedicated to Discussions and Proposals you may use for this purpose.

@react-native-bot react-native-bot added Ran Commands One of our bots successfully processed a command. 📋No Template labels Sep 19, 2018
@augustl
Copy link
Contributor

augustl commented Oct 18, 2018

For people on Google that end up here, you can make your activities extends ReactFragmentActivity rather than ReactActivity. That class has getSupportFragmentManager() and all that jazz.

@chriscoderdr
Copy link

@augustl ReactFragmentActivity is marked as deprecated and will be removed soon, you shouldn't be using it.

@augustl
Copy link
Contributor

augustl commented Oct 19, 2018

As far as I can tell, there's no other way of doing it in 0.56 that I can see, so I thought I'd just mention it here in case anyone else found this issue on Google :)

@kesha-antonov
Copy link
Contributor

Any hints for RN 0.60+?

@facebook facebook locked as resolved and limited conversation to collaborators Sep 19, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Sep 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

5 participants