예제 #1
0
  private void firstEnter() {

    if (mLiteBlueService != null) {

      // 确认蓝牙
      if (!mLiteBlueService.isEnable()) {
        showIosDialog();
      } else {
        if (mLiteBlueService.isBinded()) { // 当本地绑定时,开启搜索。
          mLiteBlueService.startScanUsePeriodScanCallback();
        }
      }
    }

    // 加载天气
    LoadWeatherJsonTask taskFirst = new LoadWeatherJsonTask(MSG_FORECAST, this, mHandler);
    taskFirst.setOnProgressChangeListener(this);
    String city = (String) SharedPreferenceUtil.get(this, Constant.SHARE_PLACE, "beijing");
    if (!city.equals("")) {
      taskFirst.execute(YahooUtil.getForecastUrl(city));
      tvWeatherAddress.setText(city);
    } else {

    }
  }
예제 #2
0
  @Override
  protected void onResume() {
    // if
    // (mSimpleBlueService.getConnectState()==BluetoothProfile.STATE_CONNECTED)
    // {
    if (mLiteBlueService != null) {

      if (mLiteBlueService.isBinded() && mLiteBlueService.isServiceDiscovered()) {
        mHandler.post(runRssi);
      }
    }
    setClockTime();
    super.onResume();
  }