This is a simple and silly question but I am developing an application in which i am showing a popup menu on click of a button. The code is as follows:
PopupMenu popup = new PopupMenu(mContext, view);
popup.getMenu().add("A");
popup.getMenu().add("B");
popup.getMenu().add("c");
popup.show();
popup.setOnMenuItemClickListener(new OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
// My stuff
}
}
The issue is : In some devices the popup come at the bottom of button but in some devices the pop up overlaps the button or partially overlap.
How to set the popup, so that it will not overlap the button and the button is completely visible.