com.google.analytics.tracking.android
Class ExceptionReporter

java.lang.Object
  extended by com.google.analytics.tracking.android.ExceptionReporter
All Implemented Interfaces:
java.lang.Thread.UncaughtExceptionHandler

public class ExceptionReporter
extends java.lang.Object
implements java.lang.Thread.UncaughtExceptionHandler

Used to catch any uncaught exceptions and report them to Google Analytics. This class will call ServiceManager.dispatch() after calling Tracker.trackException(java.lang.String, boolean).

The exact message reported is determined by the ExceptionParser set via the setExceptionParser(com.google.analytics.tracking.android.ExceptionParser) method. See StandardExceptionParser for an example of an implementation of ExceptionParser.

All exceptions reported via this class will be reported as fatal exceptions.


Constructor Summary
ExceptionReporter(Tracker tracker, ServiceManager serviceManager, java.lang.Thread.UncaughtExceptionHandler originalHandler)
           
 
Method Summary
 ExceptionParser getExceptionParser()
           
 void setExceptionParser(ExceptionParser exceptionParser)
           
 void uncaughtException(java.lang.Thread t, java.lang.Throwable e)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExceptionReporter

public ExceptionReporter(Tracker tracker,
                         ServiceManager serviceManager,
                         java.lang.Thread.UncaughtExceptionHandler originalHandler)
Parameters:
tracker - an active Tracker instance
serviceManager - an active ServiceManager instance
originalHandler - the current DefaultUncaughtExceptionHandler
Method Detail

getExceptionParser

public ExceptionParser getExceptionParser()

setExceptionParser

public void setExceptionParser(ExceptionParser exceptionParser)

uncaughtException

public void uncaughtException(java.lang.Thread t,
                              java.lang.Throwable e)
Specified by:
uncaughtException in interface java.lang.Thread.UncaughtExceptionHandler