Sometimes it`s not convenient to use standart activity methods for creating ContextMenu (because there is can be many places in one activity but in different classes where it would be necessary to show contextmenu).
But creating dialogs is easy from any place.
How can I create dialog that looks exactly like ContextMenu? Where can I find layout of standart context menu or something like that?
I decide to use
AlertDialogs with list (http://developer.android.com/guide/topics/ui/dialogs.html#AddingAList) instead ofContextMenu. It looks like ContextMenu (perhaps, not exactly, because of different layouts), but it’s more flexible, cause I can handle different actions in different listeners.