diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/browser/TitleBarSet.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/com/android/browser/TitleBarSet.java b/src/com/android/browser/TitleBarSet.java index 4bd3fd8..873f40b 100644 --- a/src/com/android/browser/TitleBarSet.java +++ b/src/com/android/browser/TitleBarSet.java @@ -181,10 +181,12 @@ public class TitleBarSet extends Gallery * Remove the tab at the given position. */ /* package */ void removeTab(int position) { + int selection = getSelectedItemPosition(); mTitleBars.remove(position); mCount--; // Need to refresh our list setAdapter(mTitleAdapter); + setCurrentTab(selection); } /** @@ -206,6 +208,7 @@ public class TitleBarSet extends Gallery * Change to the tab at the new position. */ /* package */ void setCurrentTab(int position) { + if (position < 0 || position >= mCount) return; mIgnoreSelectedListener = true; setSelection(position); mIgnoreSelectedListener = false; |