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
[TIMOB-16207] parse string to boolean #5238
[TIMOB-16207] parse string to boolean #5238
Conversation
@@ -386,7 +386,7 @@ public boolean onEditorAction(TextView v, int actionId, KeyEvent keyEvent) | |||
fireEvent(TiC.EVENT_RETURN, data); | |||
} | |||
|
|||
Boolean enableReturnKey = (Boolean) proxy.getProperty(TiC.PROPERTY_ENABLE_RETURN_KEY); | |||
Boolean enableReturnKey = Boolean.parseBoolean(proxy.getProperty(TiC.PROPERTY_ENABLE_RETURN_KEY).toString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use TiConvert.toBoolean().
…e into TIMOB-16207-BooleanToaStringThrowsClassCastException
@@ -386,7 +386,7 @@ public boolean onEditorAction(TextView v, int actionId, KeyEvent keyEvent) | |||
fireEvent(TiC.EVENT_RETURN, data); | |||
} | |||
|
|||
Boolean enableReturnKey = (Boolean) proxy.getProperty(TiC.PROPERTY_ENABLE_RETURN_KEY); | |||
Boolean enableReturnKey = TiConvert.toBoolean(proxy.getProperty(TiC.PROPERTY_ENABLE_RETURN_KEY).toString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to call .toString(), ToConvert.toBoolean will do it for you. Simply call TiConvert.toBoolean(proxy.getProperty(TiC.PROPERTY_ENABLE_RETURN_KEY));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Code reviewed. Please address comments |
Code reviewed and functionally tested. Request accepted |
…owsClassCastException [TIMOB-16207] parse string to boolean
…ngThrowsClassCastException [TIMOB-16207] parse string to boolean
https://jira.appcelerator.org/browse/TIMOB-16207