locationManager.getLastKnownLocation() return null

后端 未结 5 1214
天命终不由人
天命终不由人 2020-12-16 13:32

i dont understand why locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER); return the location null. I gave all permission but its reutning

5条回答
  •  时光取名叫无心
    2020-12-16 14:00

    When you use GPS as provider then it gives your result with in 1 to 2 mnts so you have to contentiously check for that when get location stop and Network Provider gives you immediate locationwhen you request. So you dont get immediate Location lat lon in GPS provider.

    GPS take 1 to 2 only first time then after it will give location you on call...

提交回复
热议问题