简体   繁体   中英

How do I make an int appear in LogCat in Eclipse with Java/Android?

Here is my code for Xcode and iOS:

NSLog(@"EAN-8: %d", finalNumber);

How do I do the same thing on Java so it appears in the LogCat?

Thanks.

Log.d("MyApplication", String.format("EAN-8: %d", finalNumber));

The first parameter is called the tag, which you can use to filter Logcat output if needed. See the docs for more info/log severities.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM