Code example for PopupWindow

Methods: getContentViewsetContentViewshowAsDropDown

0
		View tView = mViewArray.get(selectPosition).getChildAt(0);
		if (tView instanceof ViewBaseAction) {
			ViewBaseAction f = (ViewBaseAction) tView;
			f.show();
		} 
		if (popupWindow.getContentView() != mViewArray.get(position)) {
			popupWindow.setContentView(mViewArray.get(position));
		} 
		popupWindow.showAsDropDown(this, 0, 0);
	} 
 
	/** 
	 * 如果菜单成展开状态,则让菜单收回去 
	 */ 
	public boolean onPressBack() { 
		if (popupWindow != null && popupWindow.isShowing()) {
			popupWindow.dismiss();
			hideView(); 
			if (selectedButton != null) {
				selectedButton.setChecked(false);
			}