I\'m trying to create a custom popup menu that I would like to position on the overflow menu button of the actionbar (am using a Toolbar with setSupportA
Toolbar
setSupportA
I learnt how to get a view from a menuitem here: Android : Get view Reference to a Menu Item
Call View v = findViewById(R.id.overflow) within your onOptionsItemSelected method.
View v = findViewById(R.id.overflow)
onOptionsItemSelected
Use that view as your anchor in your popupmenu: PopupMenu popupMenu = new PopupMenu(this, v);
PopupMenu popupMenu = new PopupMenu(this, v);