这是个坏主意,在Android的例外是这样使用的printStackTrace()?
}赶上(例外五){
e.printStackTrace();
}
解决方案
是的,这是一个坏主意。你应该使用Android的内置专为这些目的而设计的日志类:http://developer.android.com/reference/android/util/Log.html
它给你的选项来记录调试消息,警告,错误等。
Is it a bad idea to use printStackTrace() in Android Exceptions like this?
} catch (Exception e) {
e.printStackTrace();
}
解决方案
Yes, it is a bad idea. You should instead use Android's built-in log class specifically designed for these purposes: http://developer.android.com/reference/android/util/Log.html
It gives you options to log debug messages, warnings, errors etc.