File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
core/java/com/android/internal/widget Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 2929import android .view .Gravity ;
3030import android .view .View ;
3131import android .view .ViewGroup ;
32+ import android .view .ViewParent ;
3233import android .view .animation .DecelerateInterpolator ;
3334import android .widget .AdapterView ;
3435import android .widget .BaseAdapter ;
@@ -392,7 +393,11 @@ public void update() {
392393 final ActionBar .Tab tab = mTab ;
393394 final View custom = tab .getCustomView ();
394395 if (custom != null ) {
395- addView (custom );
396+ final ViewParent customParent = custom .getParent ();
397+ if (customParent != this ) {
398+ if (customParent != null ) ((ViewGroup ) customParent ).removeView (custom );
399+ addView (custom );
400+ }
396401 mCustomView = custom ;
397402 if (mTextView != null ) mTextView .setVisibility (GONE );
398403 if (mIconView != null ) {
You can’t perform that action at this time.
0 commit comments