Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is it possible to write a boolean array to a parcel but not a boolean?

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?

like image 892
rogermushroom Avatar asked Nov 17 '11 17:11

rogermushroom


2 Answers

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).

like image 132
Jonathan Schneider Avatar answered Nov 01 '22 03:11

Jonathan Schneider


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

See bug 5973.

like image 1
davidcesarino Avatar answered Nov 01 '22 02:11

davidcesarino