am 21ffb08a: Merge "Fix obtainStyledAttribute not to look for default"

* commit '21ffb08a73d3686abfa43f8e4eeae1afc09284d7':
  Fix obtainStyledAttribute not to look for default
main
Satoshi Kataoka 2011-10-03 00:51:27 -07:00 committed by Android Git Automerger
commit 782b05fa74
1 changed files with 2 additions and 2 deletions

View File

@ -259,9 +259,10 @@ public class KeyboardBuilder<KP extends KeyboardParams> {
params.mTouchPositionCorrectionRadii = null; params.mTouchPositionCorrectionRadii = null;
final TypedArray a = context.obtainStyledAttributes( final TypedArray a = context.obtainStyledAttributes(
null, R.styleable.Keyboard, R.attr.keyboardStyle, R.style.Keyboard); null, R.styleable.Keyboard, R.attr.keyboardStyle, 0);
params.mThemeId = a.getInt(R.styleable.Keyboard_themeId, 0); params.mThemeId = a.getInt(R.styleable.Keyboard_themeId, 0);
final int resourceId = a.getResourceId(R.styleable.Keyboard_touchPositionCorrectionData, 0); final int resourceId = a.getResourceId(R.styleable.Keyboard_touchPositionCorrectionData, 0);
a.recycle();
if (resourceId == 0) { if (resourceId == 0) {
if (LatinImeLogger.sDBG) if (LatinImeLogger.sDBG)
throw new RuntimeException("touchPositionCorrectionData is not defined"); throw new RuntimeException("touchPositionCorrectionData is not defined");
@ -269,7 +270,6 @@ public class KeyboardBuilder<KP extends KeyboardParams> {
} }
final String[] data = context.getResources().getStringArray(resourceId); final String[] data = context.getResources().getStringArray(resourceId);
a.recycle();
final int dataLength = data.length; final int dataLength = data.length;
if (dataLength % TOUCH_POSITION_CORRECTION_RECORD_SIZE != 0) { if (dataLength % TOUCH_POSITION_CORRECTION_RECORD_SIZE != 0) {
if (LatinImeLogger.sDBG) if (LatinImeLogger.sDBG)