久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <legend id='z7rlL'><style id='z7rlL'><dir id='z7rlL'><q id='z7rlL'></q></dir></style></legend>

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

    <tfoot id='z7rlL'></tfoot>

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

        <bdo id='z7rlL'></bdo><ul id='z7rlL'></ul>
    1. 如何獲取未過期的位置?

      How to get location that isn#39;t out of date?(如何獲取未過期的位置?)
      • <tfoot id='81K66'></tfoot>

            <tbody id='81K66'></tbody>
            <i id='81K66'><tr id='81K66'><dt id='81K66'><q id='81K66'><span id='81K66'><b id='81K66'><form id='81K66'><ins id='81K66'></ins><ul id='81K66'></ul><sub id='81K66'></sub></form><legend id='81K66'></legend><bdo id='81K66'><pre id='81K66'><center id='81K66'></center></pre></bdo></b><th id='81K66'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='81K66'><tfoot id='81K66'></tfoot><dl id='81K66'><fieldset id='81K66'></fieldset></dl></div>
                <bdo id='81K66'></bdo><ul id='81K66'></ul>
                <legend id='81K66'><style id='81K66'><dir id='81K66'><q id='81K66'></q></dir></style></legend>

                <small id='81K66'></small><noframes id='81K66'>

                本文介紹了如何獲取未過期的位置?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                啟用 GPS 后,需要一些時間才能準備好 GPS.所以使用這個代碼可能會得到一個過時的位置:位置 = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);我無法使用已過期的位置.如何獲得我需要的位置?

                After GPS is enabled, it will take some time before the GPS is ready. So use this code may get a location that is out of date: location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER); I can't use the location that is out of date. How can I get the location that I need?

                這是一個類似的問題:Android:getLastKnownLocation 過期 - 如何強制位置刷新?

                從中,我可以使用 LocationListener 獲取更新的位置,該位置應該不會過時.這是正確的.但是我該如何處理這種情況:

                From it, I can use LocationListener to get the updated location, which should be not out of date. It's correct. But how can I handle this case:

                我已經啟用了 GPS,然后啟動我的應用程序.如果我呆在一個地方不動,那么 onLocationChanged() 將不會被調用.所以不能用這個方法來判斷getLastKnownLocation()的返回值是不是過期了?

                I have already enabled GPS, and then start my app. If I stay at one place and don't move, then onLocationChanged() won't be called. So I can't use this method to judge whether the return value of getLastKnownLocation() is not out-of-date?

                有什么想法嗎?

                推薦答案

                如何獲取未過期的位置?

                How to get location that isn't out of date?

                您調用 requestLocationUpdates() 的 minTime 為 1000 毫秒,對于 onLocationChanged() 中的每個 Location,您調用 getAccuracy().如果您可以接受準確度,請調用 removeUpdates().

                You call requestLocationUpdates() with the minTime of 1000 ms, for every Location in onLocationChanged(), you call getAccuracy(). If the accuracy is acceptable for you, call removeUpdates().

                所以我不能用這個方法來判斷getLastKnownLocation()的返回值是否過時

                So I can't use this method to judge whether the return value of getLastKnownLocation() is not out-of-date

                我認為它返回的 Location 對象將包含一個 時間戳.您可以為現在與位置的 getTime()

                I think the Location object that it returns will contain a time stamp. You can set a tolerance for the time difference between now and the Location's getTime()

                這篇關于如何獲取未過期的位置?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                相關文檔推薦

                Help calculating X and Y from Latitude and Longitude in iPhone(幫助從 iPhone 中的緯度和經度計算 X 和 Y)
                Get user#39;s current location using GPS(使用 GPS 獲取用戶的當前位置)
                IllegalArgumentException thrown by requestLocationUpdate()(requestLocationUpdate() 拋出的 IllegalArgumentException)
                How reliable is LocationManager#39;s getLastKnownLocation and how often is it updated?(LocationManager 的 getLastKnownLocation 有多可靠,多久更新一次?)
                CLLocation returning negative speed(CLLocation 返回負速度)
                How to detect Location Provider ? GPS or Network Provider(如何檢測位置提供者?GPS 或網絡提供商)

              • <small id='p4ay6'></small><noframes id='p4ay6'>

                  <tbody id='p4ay6'></tbody>
                <i id='p4ay6'><tr id='p4ay6'><dt id='p4ay6'><q id='p4ay6'><span id='p4ay6'><b id='p4ay6'><form id='p4ay6'><ins id='p4ay6'></ins><ul id='p4ay6'></ul><sub id='p4ay6'></sub></form><legend id='p4ay6'></legend><bdo id='p4ay6'><pre id='p4ay6'><center id='p4ay6'></center></pre></bdo></b><th id='p4ay6'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='p4ay6'><tfoot id='p4ay6'></tfoot><dl id='p4ay6'><fieldset id='p4ay6'></fieldset></dl></div>
                  <bdo id='p4ay6'></bdo><ul id='p4ay6'></ul>
                      <legend id='p4ay6'><style id='p4ay6'><dir id='p4ay6'><q id='p4ay6'></q></dir></style></legend>
                    1. <tfoot id='p4ay6'></tfoot>

                        • 主站蜘蛛池模板: 视频一区二区三区中文字幕 | 欧美精品一区二区三区蜜桃视频 | 欧美一级视频 | 一区二区在线免费观看 | 亚洲精品国产成人 | 特黄色一级毛片 | 91 久久| 久久一 | 亚洲成人一区二区 | 久久久久国产精品一区二区 | 国产精品日韩一区二区 | 日日干夜夜操 | 天天干天天爽 | 成人免费观看男女羞羞视频 | 国产传媒视频在线观看 | 污免费网站 | 一级黄色绿像片 | 亚洲成人福利视频 | 成人av激情| 欧美一区二区二区 | 午夜a级理论片915影院 | av毛片| 久久综合久久久 | 欧美在线视频一区二区 | 午夜精品网站 | 色橹橹欧美在线观看视频高清 | 日本免费一区二区三区四区 | 欧美一区二区三区在线视频 | 九九热免费在线观看 | 中文字幕一区在线观看视频 | 日操夜操 | 久久久亚洲| 欧美福利视频 | 一区二区三区不卡视频 | 日本三级电影在线看 | 天堂中文av | 日韩中文字幕第一页 | 亚洲精品一区二区在线观看 | 午夜免费精品视频 | 国产一区二区三区视频 | 91传媒在线观看 |