开发者

Print the value of a boolean in Log

Is it possible for me to print the Boolean value returned from a method in a Log message? I am able to print String values, but I am not sure how to print Boolean valu开发者_StackOverflowes in Log message.


Yes.

Log.v("", "" + booleanValue);

or

Log.v("", Boolean.toString(booleanValue));


I would do it like this:

Log.d("SomeTag" , booleanValue?"true":"false");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜