Skip to content

Commit ac0f18d

Browse files
adampAndroid (Google) Code Review
authored andcommitted
Merge "Fix a bug where MenuItems would not return consistent results for item icons initialized from a drawable resource id."
2 parents ab750c5 + c4852a3 commit ac0f18d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

core/java/com/android/internal/view/menu/MenuItemImpl.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,10 @@ public Drawable getIcon() {
382382
}
383383

384384
if (mIconResId != NO_ICON) {
385-
return mMenu.getResources().getDrawable(mIconResId);
385+
Drawable icon = mMenu.getResources().getDrawable(mIconResId);
386+
mIconResId = NO_ICON;
387+
mIconDrawable = icon;
388+
return icon;
386389
}
387390

388391
return null;

0 commit comments

Comments
 (0)