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](https://github.com/facebook/react-native/issues/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 https://github.com/facebook/react-native/pull/16064 Differential Revision: D6816122 Pulled By: hramos fbshipit-source-id: ba9a6febad4884b8ab142d8c7142085367006904
This commit is contained in:
parent
40a8434bde
commit
7b1915e74d
|
@ -57,6 +57,7 @@ public class ReactSwitchManager extends SimpleViewManager<ReactSwitch> {
|
|||
// support setting custom switch text, this is fine, as all switches will measure the same
|
||||
// on a specific device/theme/locale combination.
|
||||
ReactSwitch reactSwitch = new ReactSwitch(getThemedContext());
|
||||
reactSwitch.setShowText(false);
|
||||
final int spec = View.MeasureSpec.makeMeasureSpec(
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT,
|
||||
View.MeasureSpec.UNSPECIFIED);
|
||||
|
|
Loading…
Reference in New Issue