BadParcelableException in google maps code

前端 未结 6 415
野性不改
野性不改 2020-12-15 22:43

Running slightly modified example of Google Maps throws BadParcelableException in the Google Maps code. The LatLng class is parcelable but it canno

6条回答
  •  再見小時候
    2020-12-15 23:16

    I found a workaround (kinda). In the place when it happens just try to do it for second time. It always catches the Exception and the second time the problem does not seem to happen in this place. That worked for me.

    try {
        mapIntent.putExtra(Intents.EXTRA_LATLNG, new LatLng(
            store.getLatitude(), store.getLongitude()));
    } catch (BadParcelableException e) {
        mapIntent.putExtra(Intents.EXTRA_LATLNG, new LatLng(
            store.getLatitude(), store.getLongitude()));
    }
    

提交回复
热议问题