Friday 15 February 2013

android - Turning a Parcelable object into a POJO with Parcelable child -



android - Turning a Parcelable object into a POJO with Parcelable child -

i have started helping out exisitng android project , have many classes possible in "pure" java module write junit tests against.

however, there ton of model objects implement parcelable android class.

given existing class

package com.example; public class foo implements parcelable { //...fields, getter/setters, etc. @override public void writetoparcel(....) { } public static final parcelable.creator<t> creator = new ... { public t createfromparcel() {...} public t[] newarray(int size) {....} } }

if split 2 classes (the first [parent] class in 'pure' java module)

package com.example.pure; public class foo { // ... fields , getters/setters, etc. }

and

package com.example; public class foo extends com.example.pure.foo implements parcelable { // parcelable implementation goes here. } would cause problems code (presumably in android framework) using parcelable object? are there factors consider create poor choice?

android parcelable parcel

No comments:

Post a Comment