Skip to content

[Android] fix null activity crash#1150

Merged
lelandrichardson merged 2 commits intomasterfrom
lmr--fix-null-activity-crash
Mar 21, 2017
Merged

[Android] fix null activity crash#1150
lelandrichardson merged 2 commits intomasterfrom
lmr--fix-null-activity-crash

Conversation

@lelandrichardson
Copy link
Copy Markdown
Collaborator

to: @gpeal

This is same as #1148 but applied to master.

The fix is to not use getCurrentActivity() as the context to pass into MapView. This can be null at times, but the context passed into the view manager will not be.

Additionally, this removes a memory leak with setting the react context to an instance property on the view manager.

Fixes #1147

@lelandrichardson lelandrichardson merged commit 06ab2ec into master Mar 21, 2017
@lelandrichardson lelandrichardson deleted the lmr--fix-null-activity-crash branch March 21, 2017 19:04
rops pushed a commit to tt-sport-mobile/react-native-maps that referenced this pull request Mar 24, 2017
pinpong pushed a commit to pinpong/react-native-maps that referenced this pull request Feb 28, 2025
…ctivity-crash

[Android] fix null activity crash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Random crashes due to NPE on Context#getResources() on Android

2 participants