Merge "Fixed Intent parsing error of PreferenceScreen"
diff --git a/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java b/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java
index cda8e6a..34360e7 100644
--- a/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java
+++ b/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java
@@ -772,8 +772,20 @@
      */
     @Override
     public boolean getValue(int index, TypedValue outValue) {
-        String s = getString(index);
-        return s != null && ResourceHelper.parseFloatAttribute(mNames[index], s, outValue, false);
+        // TODO: more switch cases for other types.
+        outValue.type = getType(index);
+        switch (outValue.type) {
+            case TYPE_NULL:
+                return false;
+            case TYPE_STRING:
+                outValue.string = getString(index);
+                return true;
+            default:
+                // For back-compatibility, parse as float.
+                String s = getString(index);
+                return s != null &&
+                        ResourceHelper.parseFloatAttribute(mNames[index], s, outValue, false);
+        }
     }
 
     @Override