Back to project page android-furk-app.
The source code is released under:
Apache License
If you think the Android project android-furk-app listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.simple.furk; /*from ww w. ja v a 2 s . co m*/ import android.content.Context; import android.content.SharedPreferences; /** * Created by Nicolas on 12/16/13. */ public class LogExceptionHandler implements Thread.UncaughtExceptionHandler { private SharedPreferences mPrefs; public LogExceptionHandler(Context context) { mPrefs = context.getSharedPreferences("furk_exceptions",0); } @Override public void uncaughtException(Thread thread, Throwable throwable) { SharedPreferences.Editor ed = mPrefs.edit(); String stackTrace = ""; for(StackTraceElement e : throwable.getStackTrace()) stackTrace += e.toString()+"\n"; ed.putString(throwable.hashCode()+"",throwable.toString()+ "\n\n"+ stackTrace); ed.commit(); throw new RuntimeException(throwable.getMessage()); } }