我是否注册为网络位置和GPS定位单一LocationListener的对象还是我为每一个单独的?
Do I register a single locationlistener object for both network location and gps location or do I create a separate one for each?
您可以使用相同的监听器两种。
You can use the same listener for both.
当你得到 onLocationChanged()
或 onStatusChanged()
回调可以检查传入的参数(位置或供应商),以确定回调的来源(即:网络或GPS)
When you get the onLocationChanged()
or onStatusChanged()
callback you can examine the incoming parameters (location or provider) to determine the source of the callback (ie: Network or GPS).