diff options
-rw-r--r-- | sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdCreationDialog.java | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdCreationDialog.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdCreationDialog.java index 4d24538..6be646d 100644 --- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdCreationDialog.java +++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdCreationDialog.java @@ -1417,29 +1417,28 @@ final class AvdCreationDialog extends GridDialog { */ private boolean createAvd() { String avdName = mAvdName.getText().trim(); - int targetIndex = mTargetCombo.getSelectionIndex(); + int index = mTargetCombo.getSelectionIndex(); // quick check on the name and the target selection - if (avdName.length() == 0 || targetIndex < 0) { + if (avdName.length() == 0 || index < 0) { return false; } - targetIndex = mDeviceCombo.getSelectionIndex(); - if (targetIndex >= 0 && targetIndex < mDeviceList.size()) { - Device d = mDeviceList.get(targetIndex); - // Set the properties so it gets saved to the avd's ini - mProperties.put(AvdManager.AVD_INI_DEVICE_MANUFACTURER, d.getManufacturer()); - mProperties.put(AvdManager.AVD_INI_DEVICE_NAME, d.getName()); - } - - // resolve the target. - String targetName = mTargetCombo.getItem(targetIndex); + String targetName = mTargetCombo.getItem(index); IAndroidTarget target = mCurrentTargets.get(targetName); if (target == null) { return false; } + index = mDeviceCombo.getSelectionIndex(); + if (index >= 0 && index < mDeviceList.size()) { + Device d = mDeviceList.get(index); + // Set the properties so it gets saved to the avd's ini + mProperties.put(AvdManager.AVD_INI_DEVICE_MANUFACTURER, d.getManufacturer()); + mProperties.put(AvdManager.AVD_INI_DEVICE_NAME, d.getName()); + } + // get the abi type mAbiType = SdkConstants.ABI_ARMEABI; ISystemImage[] systemImages = getSystemImages(target); |