I am trying to make a PopupMenu that appears from the bottom of the screen, specifically when I press the back button I want the menu to appear from roughly the area where the back button is. However, I can't figure out a way to have the PopupMenu expand from the bottom of the screen
Here is my code so far:
public void onBackPressed() {
PopupMenu menu = new PopupMenu(this, findViewById(R.id.view_pager), Gravity.BOTTOM);
menu.getMenuInflater().inflate(R.menu.backpressedmenu, menu.getMenu());
menu.show();
}
This just shows the menu above the top of the view_pager view, and I can't manage to make the menu appear at the bottom of the view_pager view.
I was able to find this question however it is decently out-of-date. I also found this question, but the answers did not help and it's also quite an old question.