diff --git a/mobile/android/base/TabsTray.java b/mobile/android/base/TabsTray.java index 7293f2bbca2..93e13b64d22 100644 --- a/mobile/android/base/TabsTray.java +++ b/mobile/android/base/TabsTray.java @@ -155,8 +155,8 @@ public class TabsTray extends Activity implements GeckoApp.OnTabsChangedListener if (Tabs.getInstance().getIndexOf(tab) == -1) { mWaitingForClose = false; - mTabsAdapter = new TabsAdapter(this, Tabs.getInstance().getTabsInOrder()); - mList.setAdapter(mTabsAdapter); + mTabsAdapter.removeTab(tab); + mList.invalidateViews(); mListContainer.requestLayout(); } else { View view = mList.getChildAt(position - mList.getFirstVisiblePosition()); @@ -254,6 +254,10 @@ public class TabsTray extends Activity implements GeckoApp.OnTabsChangedListener return mTabs.indexOf(tab); } + public void removeTab(Tab tab) { + mTabs.remove(tab); + } + public void assignValues(View view, Tab tab) { if (view == null || tab == null) return;