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");
精彩评论