Skip to content

Commit 7b1915e

Browse files
4ndroidevfacebook-github-bot
authored andcommitted
Fix NPE in Android Switch during measure
Summary: <!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes. Help us understand your motivation by explaining why you decided to make this change. You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html Happy contributing! --> Fixes #16000 see [Issue #16000](#16000) fix a null pointer exception while using higher version 'com.android.support:appcompat-v7' N/A [ANDROID][BUGFIX][Switch] - Fix NPE in Android Switch during measure Closes #16064 Differential Revision: D6816122 Pulled By: hramos fbshipit-source-id: ba9a6febad4884b8ab142d8c7142085367006904
1 parent 40a8434 commit 7b1915e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ReactAndroid/src/main/java/com/facebook/react/views/switchview/ReactSwitchManager.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public long measure(
5757
// support setting custom switch text, this is fine, as all switches will measure the same
5858
// on a specific device/theme/locale combination.
5959
ReactSwitch reactSwitch = new ReactSwitch(getThemedContext());
60+
reactSwitch.setShowText(false);
6061
final int spec = View.MeasureSpec.makeMeasureSpec(
6162
ViewGroup.LayoutParams.WRAP_CONTENT,
6263
View.MeasureSpec.UNSPECIFIED);

0 commit comments

Comments
 (0)