I keep getting this Serializable error. Both of my classes implement it. I cant seem to find problem. I have gone through all classes and still cant find the cause. It only happens on older Android version, 2.3 and below. Seems to be working find on 4.0+?
Update
Right this problem is back for me.
This time i get
java.lang.RuntimeException: Parcelable encountered IOException writing serializable object (name = ....datastructures.model.PortfolioAccount)
PorfolioAccount contrain all GSON object and variables.
and it caused by this
Caused by: java.io.NotSerializableException: android.os.Handler
I have checked all my classes that need to be Serializable, but still cant find nothing. Like before its only happening on old Android OS versions.
Probabily you're using an exception handling or method call that are not supported by older versions of Android.
Let me make an example:
So some of new Android 4 capabilities are not implenented in Android 2.3 like
ImageView.setLayerType. To avoid runtime error simply:This approach should be used also with exceptions handling:
NetworkOnMainThreadExceptionis not implemented in Android 2.3 so when the class is loaded (and not before!) the exceptionjava.lang.VerifyErroroccurs during runtime.