diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java
index c2e96f877a969d1bb6d308f6b8028a737b6b88ef..de64639b058471cd0aefbc5acf45794653a3dcb7 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java
@@ -169,7 +169,7 @@ public class KeyboardBuilder<KP extends KeyboardParams> {
             keyboardAttr.recycle();
             TypedArray keyAttr = res.obtainAttributes(Xml.asAttributeSet(parser),
                     R.styleable.Keyboard_Key);
-            mDefaultKeyWidth = KeyboardBuilder.getDimensionOrFraction(keyboardAttr,
+            mDefaultKeyWidth = KeyboardBuilder.getDimensionOrFraction(keyAttr,
                     R.styleable.Keyboard_Key_keyWidth, params.mBaseWidth, params.mDefaultKeyWidth);
             keyAttr.recycle();