CODE :-
/**
* Update marker position and icon
*/
private void setMarker() {
synchronized (OBJ_LOCK) {
if (mLatitude != 0.0 || mLongitude != 0.0) {
mRotatedBitmap = rotateBitmap(mOriginalMarkerBitmap, mBearing);
if (mRotatedBitmap != null) {
mCurrentPositionIcon = BitmapDescriptorFactory
.fromBitmap(mRotatedBitmap);
mCurrentLocationMarker.position(new LatLng(mLatitude,
mLongitude));
mCurrentLocationMarker.icon(mCurrentPositionIcon);
mCurrentLocationMarker.anchor(0.5f, 0.5f);
if (currentMarker != null && mCurrentPositionIcon != null) {
currentMarker.setIcon(mCurrentPositionIcon);
currentMarker.setAnchor(0.5f, 0.5f);
currentMarker.setPosition(new LatLng(mLatitude,
mLongitude));
} else {
currentMarker = mGoogleMap
.addMarker(mCurrentLocationMarker);
}
}
}
}
}
logcat-
02-03 14:28:53.621: E/AndroidRuntime(28639): FATAL EXCEPTION: main
02-03 14:28:53.621: E/AndroidRuntime(28639): java.lang.RuntimeException: Error receiving broadcast Intent { act=medigit.rtid.MESSAGE_ACTION flg=0x10 (has extras) } in medigit.rtid.RTIDMapsActivity$RTIDBroadcastReceiver@41ccd230
02-03 14:28:53.621: E/AndroidRuntime(28639): at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:765)
02-03 14:28:53.621: E/AndroidRuntime(28639): at android.os.Handler.handleCallback(Handler.java:615)
02-03 14:28:53.621: E/AndroidRuntime(28639): at android.os.Handler.dispatchMessage(Handler.java:92)
02-03 14:28:53.621: E/AndroidRuntime(28639): at android.os.Looper.loop(Looper.java:137)
02-03 14:28:53.621: E/AndroidRuntime(28639): at android.app.ActivityThread.main(ActivityThread.java:4744)
02-03 14:28:53.621: E/AndroidRuntime(28639): at java.lang.reflect.Method.invokeNative(Native Method)
02-03 14:28:53.621: E/AndroidRuntime(28639): at java.lang.reflect.Method.invoke(Method.java:511)
02-03 14:28:53.621: E/AndroidRuntime(28639): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
02-03 14:28:53.621: E/AndroidRuntime(28639): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
02-03 14:28:53.621: E/AndroidRuntime(28639): at dalvik.system.NativeStart.main(Native Method)
02-03 14:28:53.621: E/AndroidRuntime(28639): Caused by: java.lang.IllegalArgumentException: Released unknown bitmap reference
02-03 14:28:53.621: E/AndroidRuntime(28639): at maps.aq.o.a(Unknown Source)
02-03 14:28:53.621: E/AndroidRuntime(28639): at maps.af.n.b(Unknown Source)
02-03 14:28:53.621: E/AndroidRuntime(28639): at maps.af.bm.a(Unknown Source)
02-03 14:28:53.621: E/AndroidRuntime(28639): at eeo.onTransact(SourceFile:204)
02-03 14:28:53.621: E/AndroidRuntime(28639): at android.os.Binder.transact(Binder.java:326)
02-03 14:28:53.621: E/AndroidRuntime(28639): at com.google.android.gms.maps.model.internal.d$a$a.i(Unknown Source)
02-03 14:28:53.621: E/AndroidRuntime(28639): at com.google.android.gms.maps.model.Marker.setIcon(Unknown Source)
02-03 14:28:53.621: E/AndroidRuntime(28639): at medigit.rtid.RTIDMapsActivity.setMarker(RTIDMapsActivity.java:493)
02-03 14:28:53.621: E/AndroidRuntime(28639): at medigit.rtid.RTIDMapsActivity.access$20(RTIDMapsActivity.java:478)
02-03 14:28:53.621: E/AndroidRuntime(28639): at medigit.rtid.RTIDMapsActivity$RTIDBroadcastReceiver.onReceive(RTIDMapsActivity.java:461)
02-03 14:28:53.621: E/AndroidRuntime(28639): at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:755)
02-03 14:28:53.621: E/AndroidRuntime(28639): ... 9 more
Already checked following #SO Released unknown bitmap reference , but not helpful at all for me.