0

I was having a discussion with another developer and the argument arose that a static class is better then using parcelable when passing data between activities. When i check on this site the recommendation seems to be that parcelable is faster the serializable and the recommended way to send data to another activity but with more boiler plate code. If i had a static class with the info instead is that more efficient or somehow better then using parcelable ? is there a valid argument for this ? To me it seems like bad design to make a static class for this.

j2emanue
  • 60,549
  • 65
  • 286
  • 456
  • It isn't so much about efficiency as it is how you plan to use the data. Having a global static is far different than having localized bundles passed in parcelables. If you mean a singleton by `static class` then there are a lot of good uses for a singleton, but again it is important to understand the difference between statics and non-static instances. – zgc7009 Jun 21 '15 at 20:38
  • thanks for the reply. my only concern was a static class could not be reused until i cleared the data. – j2emanue Jun 21 '15 at 23:52

0 Answers0