0
我正在使用具有LatLong對象的mapsforge庫,用於在地圖上存儲點。不幸的是它只實現Serializable接口,而不是Parcelable。如何向包裹寫一個可序列化(不可Parcelable)列表
public class LatLong implements Comparable<LatLong>, Serializable
在我的應用我有對象(可以稱之爲結果)之間的LatLong點的其他列表存儲:
List<LatLong> points;
我的班級結果實現Parcelable。
我的問題是如何寫Parcel列表,其中LatLong是可序列化但不可Parcelable? writeSerializable,writeTypedList不起作用。
謝謝,它的工作。另一種解決方案是使用parcel.writeValue – user3626048