From: minkee.lee Date: Tue, 1 Sep 2015 04:46:37 +0000 (+0900) Subject: profile-tab: add checking tab index. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f424b8eb0d80b677a2dcd4f856c9036b29bd05d9;p=sdk%2Femulator%2Femulator-manager.git profile-tab: add checking tab index. - set index to zero if index < 0 Change-Id: Ifb73b2239590c76a59596a628640edce53b066ec Signed-off-by: minkee.lee --- diff --git a/src/org/tizen/emulator/manager/ui/tabfolder/ProfileTabFolder.java b/src/org/tizen/emulator/manager/ui/tabfolder/ProfileTabFolder.java index 08be90e..dedb942 100644 --- a/src/org/tizen/emulator/manager/ui/tabfolder/ProfileTabFolder.java +++ b/src/org/tizen/emulator/manager/ui/tabfolder/ProfileTabFolder.java @@ -58,12 +58,12 @@ public class ProfileTabFolder { private static final int RIGHT_BUTTON_HEIGHT = 18; private static final int RIGHT_BUTTON_GAP = 11; - private ArrayList items + private final ArrayList items = new ArrayList(5); - private ArrayList buttons + private final ArrayList buttons = new ArrayList(5); - private ArrayList rightButtons + private final ArrayList rightButtons = new ArrayList(5); private Composite mainComposite = null; @@ -129,11 +129,13 @@ public class ProfileTabFolder { buttons.add(makeTabButton(item)); } - int index = SettingInfoFile.getLastTapIndex(); - if (index >= buttons.size()) { - index = 0; + if (buttons.size() > 0) { + int index = SettingInfoFile.getLastTapIndex(); + if (index < 0 || index >= buttons.size()) { + index = 0; + } + selectionItem(buttons.get(index)); } - selectionItem(buttons.get(index)); } if(!rightButtons.isEmpty()) {