1、获取LOCATION_SERVICE系统服务。
2、创建Criteria对象,调用该对象的set方法设置查询条件。
3、调用LocationManager.getBestProvider(Criteria criteria,Boolean enabledOnly)方法,传入创建好的Criteria对象,获取最能满足给定标准(Criteria对象)的提供者名称。
4、调用LocationManager.getLastKnowLocation(),传入提供者名称,获取最后已知位置信息。
5、调用LocationManager.requstLocationUpdates(),添加LocationListener监听器。

相关文章:

  • 2022-12-23
  • 2021-06-20
  • 2021-10-27
  • 2022-12-23
  • 2022-03-01
  • 2021-12-11
  • 2021-09-13
猜你喜欢
  • 2021-11-24
  • 2022-12-23
  • 2021-05-07
  • 2022-12-23
  • 2021-07-24
  • 2022-12-23
相关资源
相似解决方案