Пример #1
0
  private void refreshList() {
    // Wait up to 60 seconds for a fix, that is accurate to 300 meters and
    // is not older than 2 minutes.
    Integer accuracy;
    isFromRefresh = true;
    iCurrentPageNo = 2;

    // Emulator returns no accuracy, so ask for fix that is worse than our
    // default accuracy.
    if ("google_sdk".equals(Build.PRODUCT)) {
      accuracy = 551;
    } else {
      accuracy = 2000;
    }

    gps = GpsLocator.getGpsLocator(this);
    gpsFix = new GpsFix(60, accuracy, 259200);
    gpsFix.getFix(gps.getBestLocation());
    // 'updateLocations(gps.getBestLocation());
    if (gpsFix.getFix(gps.getBestLocation()) == GpsFixStatus.OK_FIX) {
      updateLocations(gps.getBestLocation());
    } else {
      gps.addObserver(this);
      updateLocationView(null);
    }
  }