I created a PopupMenu that shows up when I click a button but it shows a list of menu items. I want to know if there is a way to make it grid instead of list.
button = (Button) findViewById(R.id.menu_btn);
final PopupMenu popupMenu = new PopupMenu(MainActivity.this, button);
popupMenu.getMenu().add("item 1");
popupMenu.getMenu().add("item 2");
popupMenu.getMenu().add("item 3");
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
popupMenu.show();
}
});
I actually figured out some way to do it
after than all you have to is to init() and popupInit() in onCreate()
Unfortunately, the gridView onItemClickListner doesn't work actually and I still did not figured out why!