Popup menu with icons

How to show popup menu with icons ? There are ways that involves calling a method ‘setForceShowIcons’ through reflection but i don’t think reflection is safe. Is there any other way or other approach to show similar popup menu with icons.

There is no built-in option for this in the framework classes or AndroidX. Use ListPopupWindow and pass in a ListAdapter whose rows include icons.