java.lang.IllegalStateException: MenuPopupHelper cannot be used without an anchor


Solutions on the web

Solution icon of stackoverflow
MenuPopupHelper cannot be used without an anchor

Stack trace

java.lang.IllegalStateException: MenuPopupHelper cannot be used without an anchor
	at android.support.v7.view.menu.MenuPopupHelper.show(MenuPopupHelper.java:142)
	at android.support.v7.widget.PopupMenu.show(PopupMenu.java:233)
	at com.mypackage.testexample.views.MyPopupMenu.display(MyPopupMenu.java:27)
	at com.mypackage.testexample.controllers.lite.GuestActivity.onOptionsItemSelected(GuestActivity.java:90)

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 1 year ago
5 times, 11 months ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago