Bug 766865 - java.lang.IndexOutOfBoundsException in TabsTray.addTab [r=margaret]

This commit is contained in:
Matt Brubeck 2012-06-21 14:18:58 -07:00
parent 86805cf0ba
commit 7e1dd31ebd

View File

@ -134,6 +134,10 @@ public class TabsTray extends LinearLayout
int index = Tabs.getInstance().getIndexOf(tab);
if (msg == Tabs.TabEvents.ADDED) {
if (index == -1) // If the tab has already been removed, do nothing.
return;
if (index > mTabsAdapter.getCount())
index = mTabsAdapter.getCount();
mTabsAdapter.addTab(index, tab);
mTabsAdapter.notifyDataSetChanged();
return;