mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 20:11:24 +08:00
Fix crash on API 23 where constantState.newDrawable(nativeView.getResources()); throws exception in Java. (#4959)
Fix https://github.com/bradmartin/nativescript-floatingactionbutton/issues/57 Addition to https://github.com/NativeScript/NativeScript/issues/4728
This commit is contained in:
@ -460,7 +460,11 @@ export class View extends ViewCommon {
|
||||
if (drawable) {
|
||||
const constantState = drawable.getConstantState();
|
||||
if (constantState) {
|
||||
return constantState.newDrawable(nativeView.getResources());
|
||||
try {
|
||||
return constantState.newDrawable(nativeView.getResources());
|
||||
} catch (e) {
|
||||
return drawable;
|
||||
}
|
||||
} else {
|
||||
return drawable;
|
||||
}
|
||||
|
Reference in New Issue
Block a user