To print into LogCat
, replace System.out.print()
method with Log.i()
, Log.d()
or Log.w()
method as like below...
System.out.print("ID is:"+clicked.getId());
with
Log.i("ID is:", " "+clicked.getId());
Because, System.out.print()
is designed to print in the Console
and Log.i()
is designed to print in the LogCat
.
So, to print in the LogCat
, you should use Log
class and its methods. The Log
class's methods maintain some TAG
as their first argument which helps to sort-out printed log in the LogCat
.