0

可能重复:
为什么 System.out.println 不起作用?(在安卓中)

我想在控制台中打印一些东西。我能做些什么?因为 System.out.println 不起作用。有些人说它有效,但有些人说它无效。哪一个对?谢谢

4

2 回答 2

1

System.out.println()工作,也Log.d("TAG", "message");工作,但你需要在 Eclipse 中打开 LogCat 视图,而不是控制台视图。

于 2011-04-29T16:30:54.483 回答
1

您应该使用 android SDK 中的 Log 类。http://developer.android.com/reference/android/util/Log.html

喜欢

final string tag = "myApp";
Log.d(tag,"hello world");
于 2011-04-29T16:34:32.100 回答