org.hermit.android.core
Class Errors

java.lang.Object
  extended by org.hermit.android.core.Errors

public class Errors
extends java.lang.Object

Error handling and reporting utilities.

Author:
Ian Cameron Smith

Method Summary
static Errors getInstance(Context context)
          Get the single instance of this class for the given Activity, creating it if necessary.
static void reportException(Context context, java.lang.Exception e)
          Report an unexpected exception to the user by popping up a dialog with some debug info.
 void reportException(java.lang.Exception e)
          Report an unexpected exception to the user by popping up a dialog with some debug info.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static Errors getInstance(Context context)
Get the single instance of this class for the given Activity, creating it if necessary.

Parameters:
context - The Activity for which we want an error reporter.
Returns:
The single instance of this class.

reportException

public static void reportException(Context context,
                                   java.lang.Exception e)
Report an unexpected exception to the user by popping up a dialog with some debug info. Don't report the same exception more than twice, and if we get floods of exceptions, just bomb out.

This method may be called from any thread. The reporting will be deferred to the UI thread.

Parameters:
context - The Activity for which we want an error reporter.
e - The exception.

reportException

public void reportException(java.lang.Exception e)
Report an unexpected exception to the user by popping up a dialog with some debug info. Don't report the same exception more than twice, and if we get floods of exceptions, just bomb out.

This method may be called from any thread. The reporting will be deferred to the UI thread.

Parameters:
e - The exception.