码迷,mamicode.com
首页 > 其他好文 > 详细

parcel write boolean值

时间:2015-07-15 19:10:58      阅读:240      评论:0      收藏:0      [点我收藏+]

标签:

 

http://stackoverflow.com/questions/6201311/how-to-read-write-a-boolean-when-implementing-the-parcelable-interface

 

writeToParcel:

dest.writeByte((byte) (myBoolean ? 1 : 0));     //if myBoolean == true, byte == 1

readFromParcel:

myBoolean = in.readByte() != 0;     //myBoolean == true if byte != 0

 

parcel write boolean值

标签:

原文地址:http://www.cnblogs.com/exmyth/p/4648978.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!