Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d1ad5ab2 authored by Praveena Pachipulusu's avatar Praveena Pachipulusu Committed by Gerrit - the friendly Code Review server
Browse files

frameworks/base: Fix to avoid crash when the tab is not set from app

As the current tab is not set from application, getChildTabViewAt
returns Null value. Added a condition which checks whether mSelectTab
is set to first Tab.

Change-Id: I72313697e2c1c7b66a70078e82e509bfa244721b
CRs-Fixed: 321176
CRs-Fixed: 378466
parent 0ac0d17d
Loading
Loading
Loading
Loading
+23 −21
Original line number Diff line number Diff line
@@ -330,6 +330,7 @@ public class TabWidget extends LinearLayout implements OnFocusChangeListener {
            return;
        }

        if(mSelectedTab != -1) {
           final View selectedChild = getChildTabViewAt(mSelectedTab);

           final Drawable leftStrip = mLeftStrip;
@@ -353,6 +354,7 @@ public class TabWidget extends LinearLayout implements OnFocusChangeListener {
           leftStrip.draw(canvas);
           rightStrip.draw(canvas);
        }
    }

    /**
     * Sets the current tab.