I'm trying to remove blue dot on my location and show customized image. People said it needs to change location button. And I found this answer. Google map for android my location custom button But it doesn't work for me. On a code, it looks good and no red-line. But when I initial it on my mobile and press the location button, it stopped.
Is there any body post up with full code? Every one recommend that answer, but I'm not sure which was wrong... I stick to this matter more than 3 days.... Please any body help me..
error on Android monitor
12-15 11:20:37.845 10853-10853/org.androidtown.realchangdeokgunge D/AndroidRuntime: Shutting down VM
12-15 11:20:37.855 10853-10853/org.androidtown.realchangdeokgunge W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x4166bd58)
12-15 11:20:37.855 10853-10853/org.androidtown.realchangdeokgunge E/AndroidRuntime: FATAL EXCEPTION: main
Process: org.androidtown.realchangdeokgunge, PID: 10853
java.lang.NullPointerException
at org.androidtown.realchangdeokgunge.GPSActivity.getMyLocation(GPSActivity.java:118)
at org.androidtown.realchangdeokgunge.GPSActivity.access$000(GPSActivity.java:50)
at org.androidtown.realchangdeokgunge.GPSActivity$1.onClick(GPSActivity.java:135)
at android.view.View.performClick(View.java:4457)
at android.view.View$PerformClick.run(View.java:18501)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5068)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:792)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:608)
at dalvik.system.NativeStart.main(Native Method)
error on Code
GPSActivity java:118
LatLng latLng = new LatLng(mLastLocation.getLatitude(), mLastLocation.getLongitude());
*I use mLastLocation instead of "Double.parse...." in the above linked post. I don't know why but it shows error with red-line.
GPSActivity java:50
public class GPSActivity extends FragmentActivity implements OnMapReadyCallback,
GoogleApiClient.ConnectionCallbacks,
GoogleApiClient.OnConnectionFailedListener,
LocationListener,
GoogleMap.OnInfoWindowClickListener{
GPSActivity java:135
getMyLocation();