<i id='MSE5t'><tr id='MSE5t'><dt id='MSE5t'><q id='MSE5t'><span id='MSE5t'><b id='MSE5t'><form id='MSE5t'><ins id='MSE5t'></ins><ul id='MSE5t'></ul><sub id='MSE5t'></sub></form><legend id='MSE5t'></legend><bdo id='MSE5t'><pre id='MSE5t'><center id='MSE5t'></center></pre></bdo></b><th id='MSE5t'></th></span></q></dt></tr></i><div id='MSE5t'><tfoot id='MSE5t'></tfoot><dl id='MSE5t'><fieldset id='MSE5t'></fieldset></dl></div>

        <bdo id='MSE5t'></bdo><ul id='MSE5t'></ul>
      <legend id='MSE5t'><style id='MSE5t'><dir id='MSE5t'><q id='MSE5t'></q></dir></style></legend>
    1. <small id='MSE5t'></small><noframes id='MSE5t'>

      <tfoot id='MSE5t'></tfoot>
    2. NETWORK_PROVIDER 未提供更新的位置

      时间:2023-09-02

      • <tfoot id='wbQoI'></tfoot>
            <bdo id='wbQoI'></bdo><ul id='wbQoI'></ul>
              <tbody id='wbQoI'></tbody>
            <legend id='wbQoI'><style id='wbQoI'><dir id='wbQoI'><q id='wbQoI'></q></dir></style></legend>

            <small id='wbQoI'></small><noframes id='wbQoI'>

            <i id='wbQoI'><tr id='wbQoI'><dt id='wbQoI'><q id='wbQoI'><span id='wbQoI'><b id='wbQoI'><form id='wbQoI'><ins id='wbQoI'></ins><ul id='wbQoI'></ul><sub id='wbQoI'></sub></form><legend id='wbQoI'></legend><bdo id='wbQoI'><pre id='wbQoI'><center id='wbQoI'></center></pre></bdo></b><th id='wbQoI'></th></span></q></dt></tr></i><div id='wbQoI'><tfoot id='wbQoI'></tfoot><dl id='wbQoI'><fieldset id='wbQoI'></fieldset></dl></div>

              1. 本文介绍了NETWORK_PROVIDER 未提供更新的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                LocationManager locationManager = (LocationManager)getApp().getSystemService(Context.LOCATION_SERVICE); //getApp() returns my Application object
                locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER , 1, 1, this);
                locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 1, 1, this);
                

                这就是我用来收听的代码.启用 GPS 后,一切正常.但是,如果我禁用 GPS 并依赖网络位置,它会给我带来陈旧的结果——在这种情况下,是两天前的结果.我无法让它更新.调用 getLastKnownLocation 会返回相同的陈旧结果.

                That's the code I'm using to listen. With GPS enabled, everything works fine. However, if I disable GPS and rely on network location, it gives me stale results -- in this case, from two days ago. I cannot get it to update. Calling getLastKnownLocation returns the same stale results.

                Google 地图更新正常,所以我知道这不是硬件/系统配置问题.

                Google Maps updates just fine, so I know it's not a hardware/system configuration problem.

                我在 Google 上四处搜索,发现一些人有类似的问题,但没有答案.我尝试将我的项目定位到 API 级别 8 (2.2) 和 15 (4.0.3).结果相同.我的手机正在运行 ICS.

                I've Googled around, and found a few people with similar problems, but no answers. I've tried targeting my project to API level 8 (2.2) as well as 15 (4.0.3). Same results. My phone is running ICS.

                我还尝试删除对 GPS_PROVIDER 的请求,以及在 getAllProviders() 中包含对所有内容的请求.同样的交易.

                I've also tried removing the request for GPS_PROVIDER, as well as including requests for everything in getAllProviders(). Same deal.

                知道为什么 NETWORK_PROVIDER 没有更新吗?任何帮助将不胜感激.

                Any idea why NETWORK_PROVIDER is not updating? Any help would be greatly appreciated.

                (附注:不,我通常不使用1, 1"作为时间/距离参数;我只是在调试时更改了它.)

                (P.S. No, I don't I normally use "1, 1" as my time/distance parameters; I just changed it while debugging this.)

                我忘了说是的,isProviderEnabled() 返回 true.

                I forgot to mention that yes, isProviderEnabled() returns true.

                推荐答案

                我终于找到了解决这个问题的方法(见 我的问题在这里).

                I finally found a way to solve this problem (see my question here).

                在我的 S3 Galaxy Mini 上,有类似的症状(在重新启动之前没有位置更新......),就像上面描述的那样.大多数情况下,当设备达到低电量条件时,位置信息就会停止更新,但有时即使手机充满电,也会发生这种情况.显然这是 LocationManager 中某处的问题.我设法通过使用新的 Google Play 服务 API 来绕过 LocationManager 位置(LocationClient 类).

                In my case on S3 Galaxy Mini there were similar symptoms (no location updates until reboot...) like the ones described above. Location in most cases stopped updating when the device reached low power conditions, but sometimes it just happened even when the phone was fully charged. Obviously this is a problem somewhere in the LocationManager. I managed to bypass LocationManager by using the new Google Play Services API for locations (LocationClient class).

                这可能是位置更新仍然适用于 Google 地图的原因,因为 Google 地图甚至在公开之前就使用了 Google Play Services API.

                This is probably the reason why the location updates were still working with Google Maps, because Google Maps were using Google Play Services API even before it was made public.

                我建议您关注 此链接如果遇到此问题,如何使用 Play Services API 获取位置,而不是使用 LocationManager.

                I recommend you to follow this link which shows the way how to use Play Services API to get locations instead of using LocationManager if you encounter this problem.

                我正在使用 Play Services 运行位置更新,并且绝对没有这样的问题 - 我随时都会收到定期的位置更新.

                Im running location updates with Play Services and there were absolutely no problems like this anymore - I keep receiving regular location updates anytime.

                请注意,这将要求用户必须在其设备上安装 Google Play,因此 Kindle 等设备将无法使用.它还需要至少 Android 2.2.

                Beware that this will require that the user must have Google Play installed on their device, so Kindles and the like will be out of the picture. It also requires a minimum of Android 2.2.

                这篇关于NETWORK_PROVIDER 未提供更新的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:用于定位时,手机加速度计的真实世界精度是多 下一篇:OnLocationChanged 回调永远不会被调用

                相关文章

                最新文章

                1. <small id='OIZp1'></small><noframes id='OIZp1'>

                2. <i id='OIZp1'><tr id='OIZp1'><dt id='OIZp1'><q id='OIZp1'><span id='OIZp1'><b id='OIZp1'><form id='OIZp1'><ins id='OIZp1'></ins><ul id='OIZp1'></ul><sub id='OIZp1'></sub></form><legend id='OIZp1'></legend><bdo id='OIZp1'><pre id='OIZp1'><center id='OIZp1'></center></pre></bdo></b><th id='OIZp1'></th></span></q></dt></tr></i><div id='OIZp1'><tfoot id='OIZp1'></tfoot><dl id='OIZp1'><fieldset id='OIZp1'></fieldset></dl></div>
                  • <bdo id='OIZp1'></bdo><ul id='OIZp1'></ul>
                3. <tfoot id='OIZp1'></tfoot>
                  <legend id='OIZp1'><style id='OIZp1'><dir id='OIZp1'><q id='OIZp1'></q></dir></style></legend>