Closed GoogleCodeExporter closed 9 years ago
I'm sorry, this turned out more of a usage problem rather than a bug.
I created a custom InstantiatorStrategy using the hint from that question, it
works in android 2.x but no 4.x.
Then I tried creating custom serializer for ComponentName class, but now it
gets stuck serializing Uri.StringUri (a private static inner class), how am I
supposed to write a serializer for a private class?
These classes have real simple constructors, can't these somehow be inferred
from the ivars ? Or constructed with empty values, followed by fieldserializer
filling in the ivars ?
Original comment by sofiasno...@gmail.com
on 22 Oct 2012 at 1:31
You can't rely on a private class having the fields you expect. You can use
reflection to create what you need. Though, I suggest doing serialization
differently. Perhaps the objects already have a serialization mechanism (this
is the whole purpose of Intent) that you can use, then just send those bytes.
Or maybe you can get the necessary data and use a factory whatever API you are
using provides to obtain an instance of the private class.
Original comment by nathan.s...@gmail.com
on 4 Dec 2012 at 12:30
Original issue reported on code.google.com by
sofiasno...@gmail.com
on 18 Oct 2012 at 4:09