My application uses Google Analytics to track exceptions and crashes (among other thigs). I use this function to get the stacktrace:
public static void sendErrorReportViaGoogleAnalytics(Exception e) {
e.printStackTrace();
Tracker myTracker = EasyTracker.getTracker();
myTracker.sendException(getDescription(e), false);
}
public static String getDescription(Exception t) {
final StringBuilder result = new StringBuilder();
result.append(t.toString());
result.append(',');
String oneElement;
for (StackTraceElement element : t.getStackTrace()) {
oneElement = element.toString();
result.append(oneElement);
result.append(",");
}
return result.toString();
}
This works fine, when talking about exceptions, I just call sendErrorReportViaGoogleAnalytics() in the catch part of my exception handling codes, but when it comes to crashes, I only get one line of the stacktrace, like
Binary XML file line #11: Error inflating class fragment
I set
<bool name="ga_reportUncaughtExceptions">true</bool>
in analytics.xml, as I'm using EasyTracker.
What should I do to get the full stacktrace in case of crashes as well?