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

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

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

  • <tfoot id='YTQUo'></tfoot>

        <bdo id='YTQUo'></bdo><ul id='YTQUo'></ul>

        在地圖中顯示當前位置時獲得 0.0 的緯度和經度

        Getting 0.0 for latitude and longitude while showing current location in map(在地圖中顯示當前位置時獲得 0.0 的緯度和經度)
        <i id='7aMvI'><tr id='7aMvI'><dt id='7aMvI'><q id='7aMvI'><span id='7aMvI'><b id='7aMvI'><form id='7aMvI'><ins id='7aMvI'></ins><ul id='7aMvI'></ul><sub id='7aMvI'></sub></form><legend id='7aMvI'></legend><bdo id='7aMvI'><pre id='7aMvI'><center id='7aMvI'></center></pre></bdo></b><th id='7aMvI'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='7aMvI'><tfoot id='7aMvI'></tfoot><dl id='7aMvI'><fieldset id='7aMvI'></fieldset></dl></div>
        <tfoot id='7aMvI'></tfoot>
      1. <small id='7aMvI'></small><noframes id='7aMvI'>

        <legend id='7aMvI'><style id='7aMvI'><dir id='7aMvI'><q id='7aMvI'></q></dir></style></legend>

            <tbody id='7aMvI'></tbody>

            <bdo id='7aMvI'></bdo><ul id='7aMvI'></ul>

                  本文介紹了在地圖中顯示當前位置時獲得 0.0 的緯度和經度的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在使用以下代碼來獲取我的當前位置.但我面臨的問題是,緯度和經度總是返回 0.0.我已經打開手機中的GPS設置并設置了所有權限.但我仍然面臨這個問題.

                  I am using the following code to get my current location. But the problem I am facing is, it always returns 0.0 for latitude and longitude. I have turned on the GPS settings in the phone and set all the permissions. But still I am facing this.

                  locationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
                  
                  customLocationListener = new CustomLocationListener();
                  
                  locationManager.requestLocationUpdates(
                  
                          LocationManager.GPS_PROVIDER,
                  
                          0,
                  
                          0,
                  
                          customLocationListener);
                  
                  class CustomLocationListener implements LocationListener{ ............
                  
                        public void onLocationChanged(Location argLocation) { 
                  
                           if(location != null) {     
                  
                          int latitude=(int)(argLocation.getLatitude()*1E6);   
                  
                          int longitude=(int)(argLocation.getLongitude()*1E6);
                  
                  
                                }
                         } ........ }
                  

                  你們中有人知道為什么嗎?

                  Do any one of you know why?

                  注意:我的活動擴展 MapActivity 而不是位置監聽器

                  Note : My activity extends MapActivity not Location Listener

                  推薦答案

                  試試這個方法

                  locationManager = (LocationManager) context
                                  .getSystemService(Context.LOCATION_SERVICE);
                  
                  
                          Criteria locationCritera = new Criteria();
                          String providerName = locationManager.getBestProvider(locationCritera,
                                  true);
                          if(providerName!=null)
                              location = locationManager.getLastKnownLocation(providerName);
                  
                          locationListener = new MyLocationListener();
                  
                          locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0,
                                  0, locationListener);
                  

                  在 mylocationlistener 中設置你的位置對象

                  in mylocationlistener set your location object

                  private class MyLocationListener implements LocationListener {
                  
                      public void onLocationChanged(Location loc) {
                  
                          if (loc != null) {
                              location = loc; 
                  
                          }
                      }
                  
                      public void onProviderDisabled(String provider) {
                  
                      }
                  
                      public void onProviderEnabled(String provider) {
                      }
                  
                      public void onStatusChanged(String provider, int status, Bundle extras) {
                      }
                  }
                  

                  這篇關于在地圖中顯示當前位置時獲得 0.0 的緯度和經度的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 或網絡提供商)
                  <tfoot id='ldF1U'></tfoot>
                  <legend id='ldF1U'><style id='ldF1U'><dir id='ldF1U'><q id='ldF1U'></q></dir></style></legend>
                    <tbody id='ldF1U'></tbody>
                  <i id='ldF1U'><tr id='ldF1U'><dt id='ldF1U'><q id='ldF1U'><span id='ldF1U'><b id='ldF1U'><form id='ldF1U'><ins id='ldF1U'></ins><ul id='ldF1U'></ul><sub id='ldF1U'></sub></form><legend id='ldF1U'></legend><bdo id='ldF1U'><pre id='ldF1U'><center id='ldF1U'></center></pre></bdo></b><th id='ldF1U'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='ldF1U'><tfoot id='ldF1U'></tfoot><dl id='ldF1U'><fieldset id='ldF1U'></fieldset></dl></div>
                      • <small id='ldF1U'></small><noframes id='ldF1U'>

                          <bdo id='ldF1U'></bdo><ul id='ldF1U'></ul>

                          1. 主站蜘蛛池模板: 欧美一区二区精品 | 国产欧美日韩精品一区 | 91国内精品| 日本电影一区二区 | 日韩中文字幕一区 | 91超碰在线观看 | 艹逼网| 欧美日韩高清一区二区三区 | 国产精品自拍视频 | 色又黄又爽网站www久久 | 九九精品在线 | 日韩在线观看精品 | 一级在线观看 | 欧美极品一区二区 | 国产成人精品免费视频大全最热 | 在线欧美亚洲 | 色综合欧美 | 久久草在线视频 | 人人九九| 一区二区视频 | 日韩和的一区二在线 | 秋霞在线一区 | www国产亚洲精品久久网站 | 久久亚洲一区二区三区四区 | 国产成人在线一区 | 亚洲综合在线播放 | 国产精品99视频 | 国内自拍偷拍视频 | 久久在线免费 | 女同av亚洲女人天堂 | 亚洲 中文 欧美 日韩 在线观看 | 91色站 | 国产69久久精品成人看动漫 | 欧美一级片在线播放 | 成人中文字幕在线观看 | 日韩国产欧美在线观看 | 中文在线a在线 | 亚洲精品99999 | 日本一区二区三区视频在线 | 中文字幕在线播放第一页 | 国产精品国产a |