Exemplo n.º 1
0
        @Override
        public void handleMessage(Message msg) {
          super.handleMessage(msg);
          switch (msg.what) {
            case DropdownMenu.DROPDOWN_MENU_GET_ADAPTER:
              if (msg.arg1 == DropdownMenu.DROPDOWN_MENU_BUTTON_NOT_EDIT) {
                TextView text = (TextView) msg.obj;
                if (text == soundSpinner) {
                  mDropMenu.setListViewPosition(0, 2);
                  mDropMenu.setListViewAdapter(mSoundArrays, mIndexSound);
                } else {
                  break;
                }
                mDropMenu.showDropdownListEnable(true);
              }
              break;

            case DropdownMenu.DROPDOWN_MENU_ITEM_CHICK:
              if (msg.arg1 == DropdownMenu.DROPDOWN_MENU_BUTTON_NOT_EDIT) {
                TextView text = (TextView) msg.obj;
                int position = msg.arg2;
                System.out.println(
                    "position and text:" + position + "---" + getKeySoundVal() + "--" + text);
                System.out.println("ext == soundSpinner--->" + (text == soundSpinner));
                if (text == soundSpinner) {
                  if (getKeySoundVal() != position) {
                    setKeySoundVal(position);
                    System.out.println("getKeySoundVal()-->" + getKeySoundVal());
                  }
                } else {
                  break;
                }
              }
              break;
          }
        }