gps 정보를 가져오는 모듈을 구현했습니다.

당연히 gps관련된 것은 다 on으로 바꿨는데요

이상하게 네이버 지도같은 어플을 실행한 상태에서
실행하면 제대로 갖고오는데

그냥 실행하려고 하면 정보를 전혀 갖고오지 못합니다.

왜이럴까요 도와주세요

public String getLocation() {
     
  double lat = 0;
  double lng = 0;
  String latLongString;
  String newLocation;
  String Juso;
  String buf;
  StringBuffer strbuf = new StringBuffer();
  LocationManager locationManager;
  locationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
  String provider = LocationManager.NETWORK_PROVIDER;
  Location location = locationManager.getLastKnownLocation(provider);
  
  Geocoder mGeoCoder = new Geocoder(getApplicationContext(), Locale.KOREA);
  
  
  if (location != null) {
   lat = location.getLatitude();
   lng = location.getLongitude();
   latLongString = "위도:" + lat + "\n경도:" + lng;
  } else {
   latLongString = "No location found";
  }
 
  try{
  List<Address> list_address = mGeoCoder.getFromLocation(lat, lng, 1);
 
  if (!list_address.isEmpty()){

   Address address = list_address.get(0);
     
   for (int i = 0; (buf = address.getAddressLine(i)) != null; i++){
   strbuf.append("주소:"+buf+"\n");
   }
  }
  else {
   strbuf.append("address not found\n");
  }
  
  } catch( Exception e ) {}
  
  return latLongString;

 }