如何在Java(Eclipse、android)中使用printstacktrace?

如何在Java(Eclipse、android)中使用printstacktrace?,java,android,printstacktrace,Java,Android,Printstacktrace,我正在使用eclipse开发一个android应用程序。如何查看printstacktrace的输出?在Android中,与printstacktrace()相比,您更喜欢Log类方法。您可以在DDMS中的logcat内看到Log输出。希望这有帮助。查看printstacktrace的输出 使用Logclass方法。。比如Log.i,Log.v等等 要查看日志输出,请转到DDMS>LogCat可以在DDMS->LogCat视图中看到printstacktrace的输出 请使用日志打印日志。消息类

我正在使用eclipse开发一个android应用程序。如何查看printstacktrace的输出?

在Android中,与
printstacktrace()
相比,您更喜欢
Log
类方法。您可以在DDMS中的logcat内看到
Log
输出。希望这有帮助。

查看printstacktrace的输出

使用
Log
class方法。。比如
Log.i
Log.v
等等


要查看日志输出,请转到
DDMS>LogCat

可以在DDMS->LogCat视图中看到printstacktrace的输出

请使用日志打印日志。消息类型及其相关方法调用为:

The Log.e() method is used to log errors.

The Log.w() method is used to log warnings.

The Log.i() method is used to log informational messages.

The Log.d() method is used to log debug messages.

The Log.v() method is used to log verbose messages.

The Log.wtf() method is used to log terrible failures that should never happen. (“WTF” stands for “What a Terrible Failure!” of course.)

要在eclipse上的android开发中查看日志输出,最好使用LogCat。在eclipse中,转到窗口/显示视图/其他。。。并从对话框中选择Android下的Logcat


在调试模式下启动应用程序时,所有消息都将记录在那里。您可以使用筛选器隐藏来自系统或其他应用程序的消息。

关于
异常.printStackTrace()
?@subodh OP可能想知道如何从printStackTrace获取结果,因为没有控制台可以看到它。我正在try,catch上下文中使用它:catch(异常E){E.printStackTrace();我想知道在哪里可以看到错误和原因?@ankitrawat您的E.printStackTrace()位于DDMS>LogCat中。