I am trying to show pop up using overflow button in fragment. Code is as follow
@Override
public void onClick(View view) {
PopupMenu popup = new PopupMenu(context, view);
MenuInflater inflater = popup.getMenuInflater();
inflater.inflate(R.menu.menu_now_plying, popup.getMenu());
popup.show();
}
Why it is collapsing my appbar layout? help is appreciated
Use it:
PopupMenu popupMenu = new PopupMenu(context, view, Gravity.RIGHT);