Skip to content

[Android][0.29] No longer possible to access Activity from SimpleViewManager #8661

@marcshilling

Description

@marcshilling

According to the 0.29.0 upgrade docs, it's now very easy to extend ReactContextBaseJavaModule and use getCurrentActivity to get the activity reference in native Android modules. However, it no longer appears to be possible to get access to the current activity from native Android UI Components.

Continuing a discussion started here, I need access to the activity so that I can create a FragmentManager to add a Fragment to the FrameLayout being vended from SimpleViewManager. There was a suggestion that ReactContext.getCurrentActivity() be made public, which seems like a bad idea, but I can't think of another way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions