Print the value of a boolean in Log

前端 未结 2 1857
-上瘾入骨i
-上瘾入骨i 2021-02-12 21:07

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 values in Log

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-12 21:56

    Yes.

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

    or

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

提交回复
热议问题