BadParcelableException in google maps code

前端 未结 6 414
野性不改
野性不改 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:19

    I have found a simpler workaround to this. Providing your Fragment or Activity's class loader to the bundle before perfoming any operations as such:

    savedInstanceState.setClassLoader(getClass().getClassLoader());
    

    This does not seem to work when passing directly into the MapFragment or MapView's onCreateView or onCreate though, so you'll manually have to parcel out the map's CameraPosition and pass a null bundle into those functions.

提交回复
热议问题