Remove tab only if tab exists.
Prevent crash in ActionBarTabs(ApiDemos). Change-Id: I1972fc761e8ebf245afb828fe7595bc764eaae56
This commit is contained in:
@@ -52,7 +52,9 @@ public class ActionBarTabs extends Activity {
|
||||
|
||||
public void onRemoveTab(View v) {
|
||||
final ActionBar bar = getActionBar();
|
||||
bar.removeTabAt(bar.getTabCount() - 1);
|
||||
if (bar.getTabCount() > 0) {
|
||||
bar.removeTabAt(bar.getTabCount() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
public void onToggleTabs(View v) {
|
||||
|
||||
Reference in New Issue
Block a user