Problem serializing Drawable

前端 未结 2 1649
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-22 18:41

I\'ve got a singe object which has three fields: two strings and a Drawable

public class MyObject implements Serializable {

    private static fina         


        
2条回答
  •  失恋的感觉
    2021-01-22 19:12

    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.

提交回复
热议问题