Code example for PopupMenu

0
	interface OnMenuItemClickListener { 
		public boolean onMenuItemClick(MenuItem item);
	} 
	 
	PopupMenuWrapper(Activity activity, View view) {
		menu = new PopupMenu(activity, view);
	} 
	 
	public void setOnMenuItemClickListener(final PopupMenuWrapper.OnMenuItemClickListener listener) {
		menu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
			@Override 
			public boolean onMenuItemClick(MenuItem item) {
				listener.onMenuItemClick(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.