1
if (isNetworkEnabled) {
                locationManagers.requestLocationUpdates(
                        LocationManager.NETWORK_PROVIDER,
                        MIN_TIME_BW_UPDATES,
                        MIN_DISTANCE_CHANGE_FOR_UPDATES, this);
                Log.d("Network", "Network");
                if (locationManagers != null) {
                    location = locationManagers.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
                    if (location != null) {
                        latitude = location.getLatitude();
                        longitude = location.getLongitude();

                        Geocoder geocoder;
                        List<Address> addresses;
                        geocoder = new Geocoder(this, Locale.getDefault());
                        addresses = geocoder.getFromLocation(latitude, longitude, 1);

                        address = addresses.get(0).getAddressLine(0);
                        //                              String city = addresses.get(0).getAddressLine(1);
                        //                              String country = addresses.get(0).getAddressLine(2);
                    }
                }
            }

above was my code to get location. It was working well previously. But today i am checking suddenly it wont get any location. It was skipped at this point requestLocationUpdates().I dont know where was the actual problem... i used wifi for getting location update.i checked all the settings.

Rameshbabu
  • 57
  • 8

0 Answers0