Code example for ToggleButton

Methods: setChecked, getTag

0
				public void onClick(View view) {
					// initPopupWindow(); 
					ToggleButton tButton = (ToggleButton) view;
 
					if (selectedButton != null && selectedButton != tButton) {
						selectedButton.setChecked(false);//�ָ�ǰһ��button�ĵ���״̬Ϊδ����״̬
					} 
					selectedButton = tButton;
					selectPosition = (Integer) selectedButton.getTag();
					startAnimation(); 
//					if (mOnButtonClickListener != null && tButton.isChecked()) { 
//						mOnButtonClickListener.onClick(selectPosition); 
//					} 
				} 
			}); 
		} 
	} 
	 
	private void startAnimation() { 
		if (popupWindow == null) {
			popupWindow = new PopupWindow(mViewArray.get(selectPosition), displayWidth, displayHeight);