2

I am considering different methods of passing an object from one fragment to another. I have read that passing a serialized version of an object between fragments can be a somewhat heavy transaction.

Would an alternative such as using GSON library to convert an object to JSON, and then passing the JSON string between fragment be a less memory intensive solution?

Coova
  • 1,818
  • 5
  • 36
  • 63
  • It superficially appears to me that, "either way, it's still serialization." Only one way to find out: try it and time it. – Mike Robinson May 08 '15 at 01:35

1 Answers1

1

Parcelable is the best option when it comes to passing data between Fragments. Its Android way of serializing the data and passing it between Activity and Fragments efficiently.

This answer might help you also.

Community
  • 1
  • 1
Varundroid
  • 9,135
  • 14
  • 63
  • 93