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

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

      <tfoot id='GDULT'></tfoot><legend id='GDULT'><style id='GDULT'><dir id='GDULT'><q id='GDULT'></q></dir></style></legend>

    1. 傳遞給 onLocationChanged 的??位置對(duì)象為空?

      Location object passed into onLocationChanged is null?(傳遞給 onLocationChanged 的??位置對(duì)象為空?)
      <legend id='hjvbe'><style id='hjvbe'><dir id='hjvbe'><q id='hjvbe'></q></dir></style></legend>

      <tfoot id='hjvbe'></tfoot>
      • <bdo id='hjvbe'></bdo><ul id='hjvbe'></ul>

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

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

                本文介紹了傳遞給 onLocationChanged 的??位置對(duì)象為空?的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                問(wèn)題描述

                我有一個(gè)在我的應(yīng)用程序中實(shí)現(xiàn) LocationListener 的活動(dòng),并且我的 onLocationChanged 方法直到最近一直運(yùn)行良好.由于某種原因,傳遞給該方法的 Location 對(duì)象為空.我的問(wèn)題是,為什么它是空的?如果無(wú)法獲取位置,是否傳入一個(gè)空對(duì)象?

                I have an activity that implements LocationListener in my application and my onLocationChanged method has been working perfectly up until recently. For some reason the Location object being passed into the method is null. My question is, why is it null? Does it pass in a null object if it cannot acquire a location?

                我的 GPS 已打開(kāi),我已將其設(shè)置為從 GPS 中提取位置,并且我知道我的 GPS 可以在我使用地圖時(shí)找到我并讓它定位我.

                My GPS is on and I have it set to pull a location from the GPS, and I know my GPS can get a fix on me as I used Maps and had it locate me.

                另外,我的應(yīng)用權(quán)限設(shè)置為:

                Also, I have the permission for my app set as:

                <uses-permission android:name="android.permission.INTERNET" />
                <uses-permission android:name="android.permission.CAMERA" />
                <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" />
                

                但我不認(rèn)為權(quán)限是問(wèn)題,因?yàn)槲业幕顒?dòng)是事先進(jìn)行的,并且從那時(shí)起我沒(méi)有更改權(quán)限.

                I don't believe permissions is the issue though, as my activity was working beforehand and I have not altered the permissions since then.

                這里是確定位置對(duì)象提供者的代碼:

                Here is the code that determines the provider of the location object:

                String locationProvider = this.mLocationManager.getBestProvider(mLocationCriteria, true);
                this.onLocationChanged(this.mLocationManager.getLastKnownLocation(locationProvider));
                

                這是錯(cuò)誤的 LogCat 輸出:

                Here is the LogCat output of the error:

                08-08 18:25:26.310: ERROR/MapActivity(6447): Couldn't get connection factory client
                08-08 18:26:18.771: ERROR/AndroidRuntime(6447): Uncaught handler: thread main exiting due to uncaught exception
                08-08 18:26:18.880: ERROR/AndroidRuntime(6447): java.lang.IllegalStateException: Could not execute method of the activity
                08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at android.view.View$1.onClick(View.java:2031)
                08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at android.view.View.performClick(View.java:2364)
                08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at android.view.View.onTouchEvent(View.java:4179)
                08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at android.view.View.dispatchTouchEvent(View.java:3709)
                08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
                08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
                08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
                08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
                08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
                08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)
                08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)
                08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at android.app.Activity.dispatchTouchEvent(Activity.java:2061)
                08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)
                08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)
                08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at android.os.Handler.dispatchMessage(Handler.java:99)
                08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at android.os.Looper.loop(Looper.java:123)
                08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at android.app.ActivityThread.main(ActivityThread.java:4363)
                08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at java.lang.reflect.Method.invokeNative(Native Method)
                08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at java.lang.reflect.Method.invoke(Method.java:521)
                08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
                08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
                08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at dalvik.system.NativeStart.main(Native Method)
                08-08 18:26:18.880: ERROR/AndroidRuntime(6447): Caused by: java.lang.reflect.InvocationTargetException
                08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at com.proto.screens.MyMapActivity.onLocateUserClick(MyMapActivity.java:147)
                08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at java.lang.reflect.Method.invokeNative(Native Method)
                08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at java.lang.reflect.Method.invoke(Method.java:521)
                08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at android.view.View$1.onClick(View.java:2026)
                08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     ... 21 more
                08-08 18:26:18.880: ERROR/AndroidRuntime(6447): Caused by: java.lang.NullPointerException
                08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at com.proto.screens.MyMapActivity.onLocationChanged(MyMapActivity.java:135)
                08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     ... 25 more
                

                [UPDATE] 我已經(jīng)在另一臺(tái)設(shè)備(確切地說(shuō)是 HTC MyTouch 3G)上測(cè)試了相同的代碼,它與 GPS 完美配合,但是在我的 Motorola Droid 上它崩潰了.

                [UPDATE] I have tested the same code on another device (an HTC MyTouch 3G to be precise) and it works flawlessly with the GPS, however on my Motorola Droid it crashes.

                推薦答案

                我已經(jīng)解決了這個(gè)問(wèn)題,但我不確定為什么會(huì)這樣.

                I have fixed the problem, though I'm not sure why this worked.

                我所做的是將我的活動(dòng)設(shè)置為向最佳位置提供者(在本例中為 GPS)請(qǐng)求位置更新,并將其設(shè)置為在其位置精確到 50 米時(shí)觸發(fā)我的功能.我之前所做的只是嘗試檢索最后一個(gè)已知位置,但現(xiàn)在我將其設(shè)置為等到 GPS 可以得到修復(fù).

                What I did is I set my activity to request location updates from the best location provider (in this case the GPS) and set it to trigger my function onces it has a location accurate down to 50 meters. What I was doing before was just attempting to retrieve the last known location, but now I have it set to wait until the GPS can get a fix.

                也許它沒(méi)有存儲(chǔ)我最后一個(gè)已知位置,因此返回 null.

                Perhaps it wasn't storing my last known location and thus was returning null.

                這篇關(guān)于傳遞給 onLocationChanged 的??位置對(duì)象為空?的文章就介紹到這了,希望我們推薦的答案對(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 獲取用戶的當(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ò)提供商)
                <i id='oVBPQ'><tr id='oVBPQ'><dt id='oVBPQ'><q id='oVBPQ'><span id='oVBPQ'><b id='oVBPQ'><form id='oVBPQ'><ins id='oVBPQ'></ins><ul id='oVBPQ'></ul><sub id='oVBPQ'></sub></form><legend id='oVBPQ'></legend><bdo id='oVBPQ'><pre id='oVBPQ'><center id='oVBPQ'></center></pre></bdo></b><th id='oVBPQ'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='oVBPQ'><tfoot id='oVBPQ'></tfoot><dl id='oVBPQ'><fieldset id='oVBPQ'></fieldset></dl></div>

                  <tbody id='oVBPQ'></tbody>

                <tfoot id='oVBPQ'></tfoot>

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

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

                        • <bdo id='oVBPQ'></bdo><ul id='oVBPQ'></ul>
                          主站蜘蛛池模板: 日韩成人免费视频 | 天天干狠狠干 | 波多野结衣一区二区三区在线观看 | 91免费在线视频 | 久草精品视频 | 中文字幕av在线 | 狠狠久久 | 性精品 | 91精品久久久久久久久中文字幕 | 2018国产大陆天天弄 | 日本三级做a全过程在线观看 | 欧美日韩专区 | 免费精品视频一区 | 成年人黄色一级毛片 | 亚洲欧美激情国产综合久久久 | 中文久久 | 91亚洲精品国偷拍自产在线观看 | 久久国品片 | 国产一区黄色 | 日本一区二区高清不卡 | 久久国产精品久久久久久 | 四虎海外 | 日本一区二区三区在线观看 | 国产99久久久国产精品下药 | 亚洲精品在线播放 | 精品一区二区三区在线观看国产 | 欧美片网站免费 | 综合久久综合久久 | 91一区 | 亚洲日产精品 | av免费网站在线观看 | 色吧综合网 | 一区二区三区视频在线免费观看 | 日韩欧美在 | 久久国产精品一区二区三区 | 天天视频成人 | 综合色在线 | 91精品国产高清久久久久久久久 | 久久久久久国产精品免费免费狐狸 | yeyeav| 久久这里只有精品首页 |