Android examples for java.lang:Thread
apply Uncaught Exception Handler
import android.content.Context; public class Main { public static final void applyUncaughtExceptionHandler(Context context) { // remove for release build Thread.setDefaultUncaughtExceptionHandler(new ShowStacktraceUncaughtExceptionHandler()); }/*from w ww. j a va 2 s .c o m*/ } class ShowStacktraceUncaughtExceptionHandler implements java.lang.Thread.UncaughtExceptionHandler{ @Override public void uncaughtException(Thread arg0, Throwable arg1) { // TODO Auto-generated method stub } }