I\'ve got a singe object which has three fields: two strings and a Drawable
public class MyObject implements Serializable {
private static fina
You can't serialize that.
Simply put, if BitmapDrawable isn't Serializable, then you can't serialize it. Usually things like this aren't serializable because they are holding on to references to things that aren't pure data. Like a context or a handle to a drawing surface.
java.io.NotSerializableException: android.graphics.drawable.BitmapDrawable
This message seems pretty clear - the specific drawable instance in the photo
field is a BitmapDrawable, which wasn't designed to be serialized. Your class cannot be serialized without dealing with the non-serializable field.
If you can ensure your class will always have a BitmapDrawable
or a Bitmap, you can see this code for an example of how to handle a Bitmap
field:
android how to save a bitmap - buggy code