Passing objects in Android that I didn't create? -
i'm looking way of passing object didn't create , cannot modify implement parcelable in android. given jar file placed project building path it. need pass object created activity activity may use contents of jar file. right set define static, isn't best way. other option can think of using putserializable i've heard puts strain on system. so, other options?
the main problem have here if class has non-accessable private fields (through getters), cannot data parcel it. if private fields accessable, might have several possibilities:
- extending parcelable subclass (as suggested simon in comments).
- wrapping in parcelable object.
- converting parcelable object (e.g. implementation of
map)
note if object not big performance drop between parcelling , serializing shouldn't noticeable. go serializing , if performance not satisfactory consider other options.
Comments
Post a Comment