diff --git a/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java b/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java index 1d5ac0ca7346b..9da65a60a3191 100644 --- a/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java +++ b/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java @@ -638,7 +638,15 @@ public final class BridgeTypedArray extends TypedArray { } } - // not a direct id valid reference? resolve it + // not a direct id valid reference. First check if it's an enum (this is a corner case + // for attributes that have a reference|enum type), then fallback to resolve + // as an ID without prefix. + Integer enumValue = resolveEnumAttribute(index); + if (enumValue != null) { + return enumValue; + } + + // Ok, not an enum, resolve as an ID Integer idValue; if (resValue.isFramework()) {