diff options
Diffstat (limited to 'core/java/android/widget/TabHost.java')
-rw-r--r-- | core/java/android/widget/TabHost.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/core/java/android/widget/TabHost.java b/core/java/android/widget/TabHost.java index 2949208..03eea66 100644 --- a/core/java/android/widget/TabHost.java +++ b/core/java/android/widget/TabHost.java @@ -79,12 +79,14 @@ public class TabHost extends FrameLayout implements ViewTreeObserver.OnTouchMode com.android.internal.R.attr.tabWidgetStyle, 0); mTabLayoutId = a.getResourceId(R.styleable.TabWidget_tabLayout, 0); + a.recycle(); + if (mTabLayoutId == 0) { - throw new IllegalArgumentException("Invalid TabWidget tabLayout id"); + // In case the tabWidgetStyle does not inherit from Widget.TabWidget and tabLayout is + // not defined. + mTabLayoutId = R.layout.tab_indicator_holo; } - a.recycle(); - initTabHost(); } |