Take the 2-minute tour ×

Any objects can be exchanged by Intent as long as they're serializable or parceable . But protobuf objects do not implement Serializable or Parceable. Since protobuf objects implementation may change in the future, it's not advised to modify/extend them. How can you exchange by Intent protocol-buffers generated class ?

EDIT : I was using protobuf-2.3.0 where GeneratedMessage and GeneratedMessageLite don't implement Serializable. Generated messages started to implement Serializable on 2 November 2010. Protobuf-2.4.1 was released on April 2011.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

GeneratedMessage and GeneratedMessageLite both implement Serializable, so you should be able to just serialize any specific generated message class as far as I'm aware. Were you trying to serialize just Message by any chance?

share|improve this answer
Ouch my GeneratedMessage source code is different from google code. One more point for Jon . –  raychenon Oct 17 '11 at 15:07
@raychenon: It's entirely possible that it's only a recent change, of course - I didn't check the history to see when it started to implement Serializable. –  Jon Skeet Oct 17 '11 at 15:52
thanks I gave an history in Edit section –  raychenon Oct 18 '11 at 14:42
I know that is a bit irrelevant, but is there a chance anyone can post a sample code of passing a GeneratedMessage in an intent? –  Yiannis Gkoufas Jul 15 '12 at 18:59

Your Answer


