javaandroidandroid-studioexceptionprintstacktrace

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?


Solution

  • Try looking at the Android Studio Logcat and using printStackTrace(System.out).