From 72c6137a7aa5e5ada6a4aeca52f33d060742beb6 Mon Sep 17 00:00:00 2001 From: Tor Norbye Date: Fri, 4 Jan 2013 15:46:25 -0800 Subject: Handle empty flag attributes, such as gravity="" Without this, an empty string will be passed into XmlUtils.convertValueToInt, which throws an index out of range exception. Change-Id: Ibd1a140e207653b205852087f33ccb87fbbb9bbc --- tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/layoutlib') diff --git a/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java b/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java index ab5c4a6..446d139 100644 --- a/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java +++ b/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java @@ -218,7 +218,7 @@ public final class BridgeTypedArray extends TypedArray { return defValue; } - if (s == null) { + if (s == null || s.length() == 0) { return defValue; } -- cgit v1.1