// Path: app/src/main/java/com/kuahusg/weather/App.java
// public class App extends Application {
//     private static Context context;
// //    private RefWatcher watcher;
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         context = getApplicationContext();
// 
//         CrashHandler crashHandler = CrashHandler.getInstance();
//         crashHandler.init();
// 
// /*        if (LeakCanary.isInAnalyzerProcess(this)) {
//             return;
//         }
//         watcher = LeakCanary.install(this);*/
//     }
// 
//     public static Context getContext() {
//         return context;
//     }
// 
// /*    public static RefWatcher getWatcher(Context context) {
//         App app = (App) context.getApplicationContext();
//         return app.watcher;
//     }*/
// }


import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.drawable.Icon;
import android.net.Uri;
import android.os.Build;
import android.os.Environment;
import android.os.Looper;
import android.os.Message;
import android.os.Process;
import android.os.StrictMode;
import android.support.annotation.RequiresApi;
import android.widget.Toast;
import com.kuahusg.weather.App;
import com.kuahusg.weather.R;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;

            Process.killProcess(Process.myPid());
            System.exit(10);
        }

    }

    private CrashHandler() {

    }

    public void init() {
        InstanceHolder.INSTANCE.exceptionHandler = Thread.getDefaultUncaughtExceptionHandler();
        Thread.setDefaultUncaughtExceptionHandler(this);

    }

    private void handleException(final Throwable e) {
        final StackTraceElement[] elements = e.getStackTrace();
        final String message = "Message:\n" + e.getMessage() + "\n";
        final String fileName = "crash-" + System.currentTimeMillis() + ".log";


        StringBuilder sb = new StringBuilder();
        for (StackTraceElement element : elements) {
            sb.append(element.toString()).append("\n");
        }
        final String stackMessage = "\nTraceMessage: " + sb.toString();


// Path: app/src/main/java/com/kuahusg/weather/App.java
// public class App extends Application {
//     private static Context context;
// //    private RefWatcher watcher;
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         context = getApplicationContext();
// 
//         CrashHandler crashHandler = CrashHandler.getInstance();
//         crashHandler.init();
// 
// /*        if (LeakCanary.isInAnalyzerProcess(this)) {
//             return;
//         }
//         watcher = LeakCanary.install(this);*/
//     }
// 
//     public static Context getContext() {
//         return context;
//     }
// 
// /*    public static RefWatcher getWatcher(Context context) {
//         App app = (App) context.getApplicationContext();
//         return app.watcher;
//     }*/
// }


// Path: app/src/main/java/com/kuahusg/weather/util/CrashHandler.java
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.drawable.Icon;
import android.net.Uri;
import android.os.Build;
import android.os.Environment;
import android.os.Looper;
import android.os.Message;
import android.os.Process;
import android.os.StrictMode;
import android.support.annotation.RequiresApi;
import android.widget.Toast;
import com.kuahusg.weather.App;
import com.kuahusg.weather.R;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;


            Process.killProcess(Process.myPid());
            System.exit(10);
        }

    }

    private CrashHandler() {

    }

    public void init() {
        InstanceHolder.INSTANCE.exceptionHandler = Thread.getDefaultUncaughtExceptionHandler();
        Thread.setDefaultUncaughtExceptionHandler(this);

    }

    private void handleException(final Throwable e) {
        final StackTraceElement[] elements = e.getStackTrace();
        final String message = "Message:\n" + e.getMessage() + "\n";
        final String fileName = "crash-" + System.currentTimeMillis() + ".log";


        StringBuilder sb = new StringBuilder();
        for (StackTraceElement element : elements) {
            sb.append(element.toString()).append("\n");
        }
        final String stackMessage = "\nTraceMessage: " + sb.toString();


        final String toastMessage = App.getContext().getString(R.string.crash_message);