Code example for MenuItem

Methods: hasSubMenu

0
	@Override 
	public void onItemClick(final AdapterView<?> adapter, final View view, final int position, final long id) {
		mDidAction = true;
		dismiss(); 
		final MenuItem item = mAdapter.getItem(position);
		if (item.hasSubMenu()) {
			showMenu(item.getSubMenu());
		} else { 
			if (mItemClickListener != null) {
				mItemClickListener.onMenuItemClick(item);
			} 
		} 
	} 
 
	@Override 
	public boolean onTouch(final View v, final MotionEvent event) {
		if (event.getAction() == MotionEvent.ACTION_OUTSIDE) {
			mWindow.dismiss();
 
			return true; 
		}