久久久久久久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. 如何獲取未過(guò)期的位置?

      How to get location that isn#39;t out of date?(如何獲取未過(guò)期的位置?)
      • <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'>

                本文介紹了如何獲取未過(guò)期的位置?的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                問(wèn)題描述

                啟用 GPS 后,需要一些時(shí)間才能準(zhǔn)備好 GPS.所以使用這個(gè)代碼可能會(huì)得到一個(gè)過(guò)時(shí)的位置:位置 = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);我無(wú)法使用已過(guò)期的位置.如何獲得我需要的位置?

                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?

                這是一個(gè)類(lèi)似的問(wèn)題:Android:getLastKnownLocation 過(guò)期 - 如何強(qiáng)制位置刷新?

                從中,我可以使用 LocationListener 獲取更新的位置,該位置應(yīng)該不會(huì)過(guò)時(shí).這是正確的.但是我該如何處理這種情況:

                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:

                我已經(jīng)啟用了 GPS,然后啟動(dòng)我的應(yīng)用程序.如果我呆在一個(gè)地方不動(dòng),那么 onLocationChanged() 將不會(huì)被調(diào)用.所以不能用這個(gè)方法來(lái)判斷getLastKnownLocation()的返回值是不是過(guò)期了?

                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?

                有什么想法嗎?

                推薦答案

                如何獲取未過(guò)期的位置?

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

                您調(diào)用 requestLocationUpdates() 的 minTime 為 1000 毫秒,對(duì)于 onLocationChanged() 中的每個(gè) Location,您調(diào)用 getAccuracy().如果您可以接受準(zhǔn)確度,請(qǐng)調(diào)用 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().

                所以我不能用這個(gè)方法來(lái)判斷getLastKnownLocation()的返回值是否過(guò)時(shí)

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

                我認(rèn)為它返回的 Location 對(duì)象將包含一個(gè) 時(shí)間戳.您可以為現(xiàn)在與位置的 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()

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

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

                相關(guān)文檔推薦

                Help calculating X and Y from Latitude and Longitude in iPhone(幫助從 iPhone 中的緯度和經(jīng)度計(jì)算 X 和 Y)
                Get user#39;s current location using GPS(使用 GPS 獲取用戶(hù)的當(dāng)前位置)
                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 返回負(fù)速度)
                How to detect Location Provider ? GPS or Network Provider(如何檢測(cè)位置提供者?GPS 或網(wǎng)絡(luò)提供商)

              • <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国产视频在线观看 | 一级a性色生活片久久毛片波多野 | 亚洲成人av| 中文字幕一区二区三区不卡 | 国产精品久久久久久久久图文区 | 成人av观看 | 国产无套一区二区三区久久 | 99re视频在线 | 国精日本亚洲欧州国产中文久久 | 色中文在线 | 亚洲日日夜夜 | 国产一级片网站 | 国产精品高潮呻吟久久av黑人 | 精品国产一区二区三区在线观看 | 亚洲视频三 | 精品在线一区 | 青青草综合 | 久久精品欧美一区二区三区麻豆 | 欧美激情精品久久久久久 | 国产欧美一区二区三区在线看 | 免费午夜视频在线观看 | 午夜黄色 | 亚洲美女在线视频 | 99精品亚洲国产精品久久不卡 | 亚洲精品在线视频 | 亚洲视频一区在线观看 | 久久精品一区二区 | 精品综合久久 | 久久网站免费视频 | 91麻豆精品国产91久久久更新资源速度超快 | 国产精品一区三区 | 久久亚洲国产精品日日av夜夜 | 日韩欧美国产综合 | 成人av激情 | 亚洲热在线视频 | 国产激情在线观看 | 日韩精品一区二区三区中文字幕 | 91精品国产91久久综合桃花 | 欧美国产精品一区二区三区 | 亚洲国产一区视频 | 日日操夜夜操天天操 |