开发者

Save an object without using serializable

From what I understand an object that is saved using serializable saves the values of the objects within the class that made the original object. That is why you have to make objects that can't be serialized transient.

Now the object I want to save has links to many different classes and those classes are linked to other classes(I'm using andEngine). I've tried to make the class that made the object serializable but after experimenting I found out I needed to make many more classes serializable. Then anything I could not edit that needed to be serializable, I made transient. I had read this How do I preserve a complex object across Activity restarts? and hoped it could be an alternative but I assume I'd run i开发者_如何转开发nto the same problem.

Is there another way to store the actual object and not the objects within the object? Should I persevere, and continue using serializable and transient through the rest of the engine? Have I misunderstood what serializable does?

Just to be more explicit on what I am trying to do. I am trying to save a TMXTiledMap that was created using andEngine. I am making the following serializable but as stated above, am running into some issues. http://code.google.com/p/andengine/source/browse/src/org/anddev/andengine/entity/layer/tiled/tmx/TMXTiledMap.java

Thank you for your help.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜