Skip to content

Commit c4852a3

Browse files
committed
Fix a bug where MenuItems would not return consistent results for
item icons initialized from a drawable resource id. Change-Id: Ieb5245b8fe0e11b2eb788143859da1c0b3657b9f
1 parent f6b8f7b commit c4852a3

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)