Code example for PopupMenu

Methods: setOnMenuItemClickListener

	PopupMenuWrapper(Activity activity, View view) {
		menu = new PopupMenu(activity, view);
	public void setOnMenuItemClickListener(final PopupMenuWrapper.OnMenuItemClickListener listener) {
		menu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
			public boolean onMenuItemClick(MenuItem item) {
				return false; 
	public void inflate(int menuId) {
		// done without using the PopupMenu.inflate() method, which isn't available on Honeycomb. 
		// this method works on both Honeycomb and Ice Cream Sandwich. 
		MenuInflater inflater = menu.getMenuInflater();
		Menu baseMenu = menu.getMenu();
		inflater.inflate(menuId, baseMenu);