sPFFramework/src/main/java/it/polimi/spf/framework/ExceptionLogger.java
@Override
	public void uncaughtException(Thread thread, Throwable ex) {
		Date now = new Date();
		String name = FOLDER + now.getTime() + ".txt";

		try {
			File folder = new File(mContext.getExternalFilesDir(null), FOLDER);
			if (!folder.exists()) {
				folder.mkdir();
			}

			File file = new File(mContext.getExternalFilesDir(null), name);
			if (!file.exists()) {
				file.createNewFile();
			}

			PrintWriter writer = new PrintWriter(new FileWriter(file, false));
			writer.println("Exception in " + thread.getName() + " @ " + DateFormat.getDateFormat(mContext).format(now));
			ex.printStackTrace(writer);
			writer.flush();
			writer.close();

		} catch (IOException e) {
			Log.e(getClass().getSimpleName(), "Exception logging uncaught exception: ", e);
		}

		// Dispatch to default handler to make app crash
		mDefaultHandler.uncaughtException(thread, ex);
	}
@Override
	public void uncaughtException(Thread thread, Throwable ex) {
		Date now = new Date();
		String name = FOLDER + now.getTime() + ".txt";

		try {
			File folder = new File(mContext.getExternalFilesDir(null), FOLDER);
			if (!folder.exists()) {
				folder.mkdir();
			}

			File file = new File(mContext.getExternalFilesDir(null), name);
			if (!file.exists()) {
				file.createNewFile();
			}

			PrintWriter writer = new PrintWriter(new FileWriter(file, false));
			writer.println("Exception in " + thread.getName() + " @ " + DateFormat.getDateFormat(mContext).format(now));
			ex.printStackTrace(writer);
			writer.flush();
			writer.close();

		} catch (IOException e) {
			Log.e(getClass().getSimpleName(), "Exception logging uncaught exception: ", e);
		}

		// Dispatch to default handler to make app crash
		mDefaultHandler.uncaughtException(thread, ex);
	}
/*
(non-Javadoc)

@see
java.lang.Thread.UncaughtExceptionHandler#uncaughtException(java.lang
.Thread, java.lang.Throwable)