diff --git a/tools/layoutlib/bridge/src/android/content/res/BridgeResources.java b/tools/layoutlib/bridge/src/android/content/res/BridgeResources.java index 625b40d7f279f..0928ec5725401 100644 --- a/tools/layoutlib/bridge/src/android/content/res/BridgeResources.java +++ b/tools/layoutlib/bridge/src/android/content/res/BridgeResources.java @@ -416,6 +416,22 @@ public final class BridgeResources extends Resources { return 0; } + @Override + public boolean getBoolean(int id) throws NotFoundException { + Pair value = getResourceValue(id, mPlatformResourceFlag); + + if (value != null && value.getSecond().getValue() != null) { + String v = value.getSecond().getValue(); + return Boolean.parseBoolean(v); + } + + // id was not found or not resolved. Throw a NotFoundException. + throwException(id); + + // this is not used since the method above always throws + return false; + } + @Override public String getResourceEntryName(int resid) throws NotFoundException { throw new UnsupportedOperationException();