First things first.. While coding everyone wants to log something or other in console for various purposes. iPhone has NSLog and Android has Log.d , Log.v .. In debug mode of app we can just use Log.d and view the logs in LogCat Window. Can't find LogCat Window ?
This sample take values from an array and prints it in Log.
String itemValue=listArray[position]; Log.d("item value clicked is", itemValue);
How to print integer in Log.d ? Lets say you want to print length of listArray array which is an int.
Log.d("listArray length", String.format("array length = %d", listArray.length));
No comments:
Post a Comment