1// Copyright 2007 The Android Open Source Project 2 3import java.lang.Thread.UncaughtExceptionHandler; 4 5/** 6 * Report death-by-uncaught-exception. 7 */ 8public class ThreadDeathHandler implements Thread.UncaughtExceptionHandler { 9 private String mMyMessage; 10 11 public ThreadDeathHandler(String msg) { 12 mMyMessage = msg; 13 } 14 15 public void uncaughtException(Thread t, Throwable e) { 16 System.err.println("Uncaught exception " + mMyMessage + "!"); 17 e.printStackTrace(); 18 } 19} 20