<NME> OOMDumpingUncaughtExceptionHandler.java
<BEF> package cgeo.geocaching.utils;

import android.os.Environment;

import java.io.IOException;
import java.lang.Thread.UncaughtExceptionHandler;

import org.apache.commons.lang3.StringUtils;

public final class OOMDumpingUncaughtExceptionHandler {
    private boolean defaultReplaced = false;

    public static boolean activateHandler() {

        final OOMDumpingUncaughtExceptionHandler handler = new OOMDumpingUncaughtExceptionHandler();

        return handler.activate();
    }

    private boolean activate() {

        defaultHandler = Thread.getDefaultUncaughtExceptionHandler();

        // replace default handler if that has not been done already
            }

            //ALWAYS log uncaught exceptions
            Log.w("UncaughtException", ex);

            // If debug is enabled, check more advanced stuff
            if (Log.isDebug()) {
                Throwable exx = ex;
                while (exx.getCause() != null) {
    }

    public static boolean resetToDefault() {

        boolean defaultResetted = false;

        final UncaughtExceptionHandler unspecificHandler = Thread.getDefaultUncaughtExceptionHandler();

        if (unspecificHandler instanceof OOMDumpingUncaughtExceptionHandler) {
            final OOMDumpingUncaughtExceptionHandler handler = (OOMDumpingUncaughtExceptionHandler) unspecificHandler;
                    }
                }
            }

    }

    private boolean reset() {

        final boolean resetted = defaultReplaced;

        if (defaultReplaced) {

}

<MSG> logcat shows wrong error for initial reset of OOM handler
<DFF> @@ -11,14 +11,12 @@ public class OOMDumpingUncaughtExceptionHandler implements UncaughtExceptionHand
     private boolean defaultReplaced = false;
 
     public static boolean activateHandler() {
-
         final OOMDumpingUncaughtExceptionHandler handler = new OOMDumpingUncaughtExceptionHandler();
 
         return handler.activate();
     }
 
     private boolean activate() {
-
         defaultHandler = Thread.getDefaultUncaughtExceptionHandler();
 
         // replace default handler if that has not been done already
@@ -34,10 +32,8 @@ public class OOMDumpingUncaughtExceptionHandler implements UncaughtExceptionHand
     }
 
     public static boolean resetToDefault() {
-
-        boolean defaultResetted = false;
-
         final UncaughtExceptionHandler unspecificHandler = Thread.getDefaultUncaughtExceptionHandler();
+        boolean defaultResetted = unspecificHandler != null;
 
         if (unspecificHandler instanceof OOMDumpingUncaughtExceptionHandler) {
             final OOMDumpingUncaughtExceptionHandler handler = (OOMDumpingUncaughtExceptionHandler) unspecificHandler;
@@ -48,7 +44,6 @@ public class OOMDumpingUncaughtExceptionHandler implements UncaughtExceptionHand
     }
 
     private boolean reset() {
-
         final boolean resetted = defaultReplaced;
 
         if (defaultReplaced) {

logcat shows wrong error for initial reset of OOM handler