25

In the documentation for the Parcel it states a method exists

public final void writeBooleanArray (boolean[] val) 

But there is no method for writeBoolean(boolean val)

There also exists:

public final void writeLong (long val)

public final void writeLongArray (long[] val)

So a similar pattern is available for other primitive types.

Can some one explain why this is?

rogermushroom
  • 5,486
  • 4
  • 42
  • 68

2 Answers2

10

There is an open bug report on it:

http://code.google.com/p/android/issues/detail?id=5973

Evidently others agree with your assessment (and I do too).

Jonathan Schneider
  • 26,852
  • 13
  • 75
  • 99
  • You think the fact this has been an open issue for nearly 2 years is a reflection on a certain shortcoming google has in addressing android bugs as it seems so fundamental and simple, or do you think there may be some hidden architectural problem – rogermushroom Nov 17 '11 at 17:49
  • 5
    At the very least they could add a facade that implements the writeInt(myBool ? 1 : 0) and back workaround... That alone tells me there is no architectural obstacle. – Jonathan Schneider Nov 17 '11 at 17:51
  • In the spirit of open source, I strongly suggest you submit a patch :) http://source.android.com/source/index.html – Jonathan Schneider Nov 17 '11 at 17:53
1

No reason at all, seems just a miss to me. :-) Write a boolean[1] if you need.

See bug 5973.

davidcesarino
  • 16,160
  • 16
  • 68
  • 109