0

I have had location updates working all day, but suddenly this has stopped. And I have not changed the code for this.

I am doing:

    activity = this;

    Criteria criteria = new Criteria();
    criteria.setAccuracy(Criteria.ACCURACY_FINE);
    criteria.setAltitudeRequired(true);

    locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
    List<String> providers = locationManager.getProviders(criteria, true);

    for (String provider : providers) {
        System.out.println(provider);
        locationManager.requestLocationUpdates(provider, 0, 0, activity);
        location = locationManager.getLastKnownLocation(provider);
        if (location != null) {
            this.onLocationChanged(location);
        }       
    }

The only provider it prints out is remote_gps and the coordinates always comes back as 0.0.

Questioner noted that the problem "resolved itself" when he noticed his HTCOne had quite providing updates (but did not note whether he power cycled his paired phone or made some other action). See comments.

ErstwhileIII
  • 4,829
  • 2
  • 23
  • 37
Jokez80
  • 131
  • 7
  • Check two things: 1) Is your paired device (Android phone? iPhone) getting location information?; 2) is your pairing active (are you able to see "bluetooth" data? – ErstwhileIII Mar 05 '14 at 17:41
  • Thanks, I figured it out myself. For some strange reason my HTC One stoped updating my location. Never happend to me before. – Jokez80 Mar 05 '14 at 18:58
  • If you put the HTCOne in power saving mode .. some things are stopped. Did you just "reset" your HTCOne or ..??? – ErstwhileIII Mar 05 '14 at 19:25

0 Answers0