I have a param in SparseArray<int[]> , and want to serialize it.
But the writeSparseArray(Object) for Parcelable seems not support int[].
Is there any other way to serialize the SparseArray<int[]>,Or only change int[] to Object?
I have a param in SparseArray<int[]> , and want to serialize it.
But the writeSparseArray(Object) for Parcelable seems not support int[].
Is there any other way to serialize the SparseArray<int[]>,Or only change int[] to Object?
Copyright © 2021 Jogjafile Inc.
I checked Parcel.writeSparseArray() method and in my opinion there is some issue because this method should be generic like writeList(). It looks like:
and should be
or
or
So you have to implement your own implementation of this method for SparseArray object. I am not sure that it is the best solution but you can try this: