My activity has a popup window defined like this :
this.navigationMenuPopupWindow = new PopupWindow(View.inflate(this, R.layout.popup_navigation, null), ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
this.navigationMenuPopupWindow.setWidth((int) this.getResources().getDimension(R.dimen.navigation_popup_width));
this.navigationMenuPopupWindow.setBackgroundDrawable(this.getDrawable(R.drawable.main_bg_navigation_menu));
this.navigationMenuPopupWindow.setElevation(43);
this.navigationMenuPopupWindow.setFocusable(true);
this.navigationMenuPopupWindow.setOutsideTouchable(true);
I would like to position the popup under the anchor. So I naturally tried to add this line :
this.navigationMenuPopupWindow.setOverlapAnchor(false);
Unfortunately, it requires the API 23. How can I achieve the same result but that it is compatible with the API 21?
I think I can resolve this by modifying my app style, but I don't know exactly how. By the way, this can affect all the PopupWindows of the app, it's not a problem I only have that one. Thank you for your help!