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

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

  1. <tfoot id='qh3U1'></tfoot>
      <bdo id='qh3U1'></bdo><ul id='qh3U1'></ul>

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

    1. <legend id='qh3U1'><style id='qh3U1'><dir id='qh3U1'><q id='qh3U1'></q></dir></style></legend>

      onLocationChanged 不會(huì)自動(dòng)調(diào)用

      onLocationChanged is not called automatically(onLocationChanged 不會(huì)自動(dòng)調(diào)用)
    2. <legend id='6PzqN'><style id='6PzqN'><dir id='6PzqN'><q id='6PzqN'></q></dir></style></legend>
    3. <i id='6PzqN'><tr id='6PzqN'><dt id='6PzqN'><q id='6PzqN'><span id='6PzqN'><b id='6PzqN'><form id='6PzqN'><ins id='6PzqN'></ins><ul id='6PzqN'></ul><sub id='6PzqN'></sub></form><legend id='6PzqN'></legend><bdo id='6PzqN'><pre id='6PzqN'><center id='6PzqN'></center></pre></bdo></b><th id='6PzqN'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='6PzqN'><tfoot id='6PzqN'></tfoot><dl id='6PzqN'><fieldset id='6PzqN'></fieldset></dl></div>
      <tfoot id='6PzqN'></tfoot>

              <tbody id='6PzqN'></tbody>

                <bdo id='6PzqN'></bdo><ul id='6PzqN'></ul>

                <small id='6PzqN'></small><noframes id='6PzqN'>

              • 本文介紹了onLocationChanged 不會(huì)自動(dòng)調(diào)用的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                問(wèn)題描述

                我對(duì) Android 中的 onLocationChanged 事件有疑問(wèn).這是觸發(fā):

                I have a problem with onLocationChanged event in Android. Here's the triggering:

                case R.id.start: {
                    Points.add(overlay.getMyLocation()); // Points' type is ArrayList<GeoPoint>
                    mgr.requestLocationUpdates(best, 0, 3, locationListener);
                    }
                    break;
                

                這是 onLocationChanged 方法:

                And here's the onLocationChanged method:

                public void onLocationChanged(Location location) {
                    i++;
                    Points.add(overlay.getMyLocation());
                    MapOverlay mapOverlay = new MapOverlay(Points.get(i-1), Points.get(i));
                    map.getOverlays().add(mapOverlay); //does the drawing
                    mMapController.animateTo(Points.get(i));
                }
                

                因此,onLocationChanged 僅在我按下開(kāi)始"后才被調(diào)用一次.它應(yīng)該在每次位置更改時(shí)自動(dòng)調(diào)用,對(duì)嗎?在我的情況下,它不是.
                請(qǐng)幫幫我.

                So, onLocationChanged is called only once and only after I press "start". It's supposed to be called automatically every time the location has changed, right? In my case, it's not.
                Please help me.

                推薦答案

                問(wèn)題似乎解決了.在 onCreate 中,我添加了:

                Problem seems to be solved. In onCreate, I added:

                Criteria crit = new Criteria();
                crit.setAccuracy(Criteria.ACCURACY_FINE);
                best = mgr.getBestProvider(crit, false);
                mgr.requestLocationUpdates(best, 0, 1, locationListener);
                

                onLocationChanged 現(xiàn)在看起來(lái)像這樣:

                onLocationChanged now looks like that:

                @Override
                public void onLocationChanged(Location location) {
                    i++;
                    nextPoint = overlay.getMyLocation();
                    latitude = nextPoint.getLatitudeE6();
                    longtitude = nextPoint.getLongitudeE6();
                    lastPoint = new GeoPoint((int) latitude, (int) longtitude);
                    Points.add(lastPoint);
                    MapOverlay mapOverlay = new MapOverlay(Points.get(i - 1), Points.get(i));
                    map.getOverlays().add(mapOverlay);
                    mMapController.animateTo(Points.get(i));
                    nextPoint = null;
                    lastPoint = null;
                }
                

                另外,非常重要的方法:

                Also, very important methods:

                @Override
                protected void onResume() {
                    super.onResume();
                    mgr.requestLocationUpdates(best, 10000, 1, locationListener);
                }
                
                @Override
                protected void onPause() {
                    super.onPause();
                    mgr.removeUpdates(locationListener);
                }
                

                還有一些新的權(quán)限:

                <uses-permission android:name="android.permission.ACCESS_GPS" />
                        <uses-permission android:name="android.permission.ACCESS_LOCATION" />
                        <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
                        <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
                        <uses-permission android:name="android.permission.INTERNET" />
                

                這篇關(guān)于onLocationChanged 不會(huì)自動(dòng)調(diào)用的文章就介紹到這了,希望我們推薦的答案對(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ò)提供商)
                  • <tfoot id='wlIyM'></tfoot>

                      • <bdo id='wlIyM'></bdo><ul id='wlIyM'></ul>
                      • <small id='wlIyM'></small><noframes id='wlIyM'>

                        <i id='wlIyM'><tr id='wlIyM'><dt id='wlIyM'><q id='wlIyM'><span id='wlIyM'><b id='wlIyM'><form id='wlIyM'><ins id='wlIyM'></ins><ul id='wlIyM'></ul><sub id='wlIyM'></sub></form><legend id='wlIyM'></legend><bdo id='wlIyM'><pre id='wlIyM'><center id='wlIyM'></center></pre></bdo></b><th id='wlIyM'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='wlIyM'><tfoot id='wlIyM'></tfoot><dl id='wlIyM'><fieldset id='wlIyM'></fieldset></dl></div>
                        <legend id='wlIyM'><style id='wlIyM'><dir id='wlIyM'><q id='wlIyM'></q></dir></style></legend>
                            <tbody id='wlIyM'></tbody>
                          主站蜘蛛池模板: 久久精品色视频 | 成人网av | 日本久久久影视 | a在线观看免费 | 欧美自拍网站 | 中文字幕亚洲一区 | 99亚洲 | 日韩一区三区 | 九九综合 | 国内自拍第一页 | 一区二区三区免费观看 | 91视频在线观看免费 | 亚洲国产一区二区三区在线观看 | 国产在线观看免费 | 成人一区在线观看 | 99久久婷婷国产综合精品电影 | 日韩在线观看精品 | 成人一区二区在线 | 91超碰在线观看 | av日韩高清| 在线看片福利 | 免费观看的黄色网址 | 日韩一区不卡 | 欧美亚洲高清 | 久久免费精彩视频 | 欧美三级在线 | h视频免费在线观看 | 国产十日韩十欧美 | 国产美女精品视频 | 免费看国产一级特黄aaaa大片 | 午夜伊人 | 精产国产伦理一二三区 | a级大片免费观看 | 久久久免费在线观看 | 另类视频区 | 欧美成人高清 | 亚洲一区二区在线 | 91xxx在线观看 | 99在线免费观看 | 一区二区三区高清在线观看 | 久久精品青青大伊人av |