Android Open Source - android-furk-app Log Exception Handler






From Project

Back to project page android-furk-app.

License

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.

Java Source Code

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());

    }
}




Java Source Code List

com.simple.furk.APIClient.java
com.simple.furk.APIUtils.java
com.simple.furk.FileActivity.java
com.simple.furk.FurkServiceGuideExtension.java
com.simple.furk.Furk.java
com.simple.furk.LogExceptionHandler.java
com.simple.furk.LoginActivity.java
com.simple.furk.MainActivity.java
com.simple.furk.NavigationDrawerFragment.java
com.simple.furk.SearchActivity.java
com.simple.furk.SettingsActivity.java
com.simple.furk.adapter.ActiveFilesAdapter.java
com.simple.furk.adapter.FilesAdapter.java
com.simple.furk.adapter.MyFilesAdapter.java
com.simple.furk.adapter.SearchFilesAdapter.java
com.simple.furk.adapter.TFilesAdapter.java