英文:
Why doesn't printStackTrace() print anything?
问题
I am trying to catch errors made by my Android Java project. I am using the code exceptionVar.printStackTrace()
, but this doesn't print anything. I was hoping that printStackTrace()
would print the error to the Android Studio console, but nothing appears. In fact, nothing happens at all! There is no indication, on my Android device or in Android Studio, that any errors occurred or were printed using printStackTrace()
.
How do I make this method print the error to the Android Studio console? Is there a setting I can change to make printed errors appear on the console?
英文:
I am trying to catch errors made by my Android Java project. I am using the code exceptionVar.printStackTrace()
, but this doesn't print anything. I was hoping that printStackTrace()
would print the error to the Android Studio console, but nothing appears. In fact, nothing happens at all! There is no indication, on my Android device or in Android Studio, that any errors occurred or were printed using printStackTrace()
.
How do I make this method print the error to the Android Studio console? Is there a setting I can change to make printed errors appear on the console?
答案1
得分: 0
尝试查看Android Studio的Logcat,并使用printStackTrace(System.out)
。
英文:
Try looking at the Android Studio Logcat and using printStackTrace(System.out)
.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论