Longitude and latitude GPSTracker Android always return 0,0

前端 未结 3 1839
独厮守ぢ
独厮守ぢ 2020-12-03 12:43

I am implementing GPS Tracker for getting Longitude and latitude from http://www.androidhive.info/2012/07/android-gps-location-manager-tutorial/.

To get value Longi

3条回答
  •  一生所求
    2020-12-03 13:27

    You're not updating received location in onLocationChanged(), try this:

    @Override
    public void onLocationChanged(Location location) {
        this.location = location;
        getLatitude();
        getLongitude();
    }
    

提交回复
热议问题