Last active
December 19, 2015 02:59
-
-
Save px-amaac/5887355 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void getCurrentLocation() { | |
if (servicesConnected()) { | |
if (pP.getLat() == 0.0 && pP.getLong() == 0.0) { // no latlng set | |
// yet. | |
Location loc = mLocationClient.getLastLocation(); | |
if (null == loc) { | |
getCurrentLocation(); | |
}else{ | |
pP.setLat(loc.getLatitude()); | |
pP.setLong(loc.getLongitude()); | |
} | |
} | |
} | |
setMarker(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void getCurrentLocation() { | |
if (servicesConnected()) { | |
if (pP.getLat() == 0.0 && pP.getLong() == 0.0) { // no latlng set | |
// yet. | |
Location loc = mLocationClient.getLastLocation(); | |
pP.setLat(loc.getLatitude());//<<<<<Error on this line loc null? | |
pP.setLong(loc.getLongitude()); | |
} | |
} | |
} | |
setMarker(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
06-28 11:22:28.270: E/AndroidRuntime(8183): FATAL EXCEPTION: main | |
06-28 11:22:28.270: E/AndroidRuntime(8183): java.lang.NullPointerException | |
06-28 11:22:28.270: E/AndroidRuntime(8183): at com.appdomum.metercheater.MainActivity.getCurrentLocation(MainActivity.java:272) | |
06-28 11:22:28.270: E/AndroidRuntime(8183): at com.appdomum.metercheater.MainActivity.onConnected(MainActivity.java:185) | |
06-28 11:22:28.270: E/AndroidRuntime(8183): at com.google.android.gms.internal.p.k(Unknown Source) | |
06-28 11:22:28.270: E/AndroidRuntime(8183): at com.google.android.gms.internal.p$f.a(Unknown Source) | |
06-28 11:22:28.270: E/AndroidRuntime(8183): at com.google.android.gms.internal.p$f.a(Unknown Source) | |
06-28 11:22:28.270: E/AndroidRuntime(8183): at com.google.android.gms.internal.p$b.p(Unknown Source) | |
06-28 11:22:28.270: E/AndroidRuntime(8183): at com.google.android.gms.internal.p$a.handleMessage(Unknown Source) | |
06-28 11:22:28.270: E/AndroidRuntime(8183): at android.os.Handler.dispatchMessage(Handler.java:99) | |
06-28 11:22:28.270: E/AndroidRuntime(8183): at android.os.Looper.loop(Looper.java:137) | |
06-28 11:22:28.270: E/AndroidRuntime(8183): at android.app.ActivityThread.main(ActivityThread.java:4745) | |
06-28 11:22:28.270: E/AndroidRuntime(8183): at java.lang.reflect.Method.invokeNative(Native Method) | |
06-28 11:22:28.270: E/AndroidRuntime(8183): at java.lang.reflect.Method.invoke(Method.java:511) | |
06-28 11:22:28.270: E/AndroidRuntime(8183): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) | |
06-28 11:22:28.270: E/AndroidRuntime(8183): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) | |
06-28 11:22:28.270: E/AndroidRuntime(8183): at dalvik.system.NativeStart.main(Native Method) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment