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

Commit 3cefe0e2 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Gets the contextual drawable correctly when rotating device"

parents 39a6834c 90a56df8
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -67,9 +67,15 @@ public class ContextualButton extends ButtonDispatcher {
    }

    protected KeyButtonDrawable getNewDrawable() {
        return KeyButtonDrawable.create(getContext(), mIconResId, false /* shadow */);
        return KeyButtonDrawable.create(getContext().getApplicationContext(), mIconResId,
                false /* shadow */);
    }

    /**
     * This context is from the view that could be stale after rotation or config change. To get
     * correct resources use getApplicationContext() as well.
     * @return current view context
     */
    protected Context getContext() {
        return getCurrentView().getContext();
    }