Serialization problem with Enums at Android

后端 未结 3 1471
南笙
南笙 2021-01-16 11:24

I\'m using XStream to serialize some objects to XML, and am facing a problem with Enums. The exception I get when I try to serialize the object: \"ObjectAccessException: inv

3条回答
  •  迷失自我
    2021-01-16 11:49

    You can just register EnumConverter() from xstream package.

    xml.registerConverter(new EnumConverter());
    

提交回复
热议问题