获取LocationManager的实例,调用Context的getSystemService()方法获取到,getSystemService()接收一个字符串参数用于确定哪个系统服务,传入Context.LOCATION_SERVICE,
例如:
LocationManager locationManager = (LocationManager)
getSystemService(Context.LOCATION_SERVICE);
例如:
LocationManager locationManager = (LocationManager)
getSystemService(Context.LOCATION_SERVICE);