I\'m trying to create a simple menu with one button that will call a method to clear the array. I don\'t want to use xml because all I need is one button.
Something like
Here i implemented popup menu dynamically by using a click listener.
Dynamic_PopUpMenu.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
PopupMenu menu = new PopupMenu(DialogCheckBox.this, v);
menu.getMenu().add("AGIL"); // menus items
menu.getMenu().add("Dash"); // menus items
menu.getMenu().add("AGILarasan");
menu.getMenu().add("Arasan");
menu.show();
}
});