コード例 #1
0
        /*
         * (non-Javadoc)
         *
         * @see android.os.Handler#handleMessage(android.os.Message)
         */
        public void handleMessage(Message msg) {
          super.handleMessage(msg);
          handler_key key = handler_key.values()[msg.what];
          switch (key) {
            case TICK_TIME:
              secondleft--;
              if (secondleft <= 0) {
                timer.cancel();
                sendEmptyMessage(handler_key.CONFIG_FAILED.ordinal());
              } else {
                tvTick.setText(secondleft + "");
              }
              break;

            case CHANGE_WIFI:
              showLayout(UI_STATE.PswInput);
              break;
            case CONFIG_SUCCESS:
              showLayout(UI_STATE.ResultSuccess);
              break;
            case CONFIG_FAILED:
              showLayout(UI_STATE.ResultFailed);
              break;
          }
        }
コード例 #2
0
 /*
  * (non-Javadoc)
  *
  * @see com.gizwits.framework.activity.BaseActivity#didSetDeviceWifi(int,
  * com.xtremeprog.xpgconnect.XPGWifiDevice)
  */
 @Override
 protected void didSetDeviceWifi(int error, XPGWifiDevice device) {
   if (error == 0) {
     handler.sendEmptyMessage(handler_key.CONFIG_SUCCESS.ordinal());
   } else {
     handler.sendEmptyMessage(handler_key.CONFIG_FAILED.ordinal());
   }
 }