Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Customize Error Message

Customize Error Message

Customize Error Message for Android

How to catch Uncaught Exception.

magiepooh

June 22, 2017
Tweet

More Decks by magiepooh

Other Decks in Technology

Transcript

  1. private static Thread.UncaughtExceptionHandler defaultUEH;
 private static Thread.UncaughtExceptionHandler caughtExceptionHandler =
 new

    Thread.UncaughtExceptionHandler() {
 @TargetApi(Build.VERSION_CODES.KITKAT) @Override
 public void uncaughtException(Thread thread, Throwable throwable) {
 // do something defaultUEH.uncaughtException(thread, throwable);
 }
 }; @Override public void onCreate() {
 super.onCreate();
 Fabric.with(this, new Crashlytics());
 defaultUEH = Thread.getDefaultUncaughtExceptionHandler();
 Thread.setDefaultUncaughtExceptionHandler(caughtExceptionHandler);
 } ApplicationΫϥε
  2. private static Thread.UncaughtExceptionHandler defaultUEH;
 private static Thread.UncaughtExceptionHandler caughtExceptionHandler =
 new

    Thread.UncaughtExceptionHandler() {
 @TargetApi(Build.VERSION_CODES.KITKAT) @Override
 public void uncaughtException(Thread thread, Throwable throwable) {
 // do something defaultUEH.uncaughtException(thread, throwable);
 }
 }; @Override public void onCreate() {
 super.onCreate();
 Fabric.with(this, new Crashlytics());
 defaultUEH = Thread.getDefaultUncaughtExceptionHandler();
 Thread.setDefaultUncaughtExceptionHandler(caughtExceptionHandler);
 } ApplicationΫϥε
  3. private static Thread.UncaughtExceptionHandler defaultUEH;
 private static Thread.UncaughtExceptionHandler caughtExceptionHandler =
 new

    Thread.UncaughtExceptionHandler() {
 @TargetApi(Build.VERSION_CODES.KITKAT) @Override
 public void uncaughtException(Thread thread, Throwable throwable) {
 // do something defaultUEH.uncaughtException(thread, throwable);
 }
 }; @Override public void onCreate() {
 super.onCreate();
 Fabric.with(this, new Crashlytics());
 defaultUEH = Thread.getDefaultUncaughtExceptionHandler();
 Thread.setDefaultUncaughtExceptionHandler(caughtExceptionHandler);
 } ApplicationΫϥε
  4. private static Thread.UncaughtExceptionHandler defaultUEH;
 private static Thread.UncaughtExceptionHandler caughtExceptionHandler =
 new

    Thread.UncaughtExceptionHandler() {
 @TargetApi(Build.VERSION_CODES.KITKAT) @Override
 public void uncaughtException(Thread thread, Throwable throwable) {
 // do something defaultUEH.uncaughtException(thread, throwable);
 }
 }; @Override public void onCreate() {
 super.onCreate();
 Fabric.with(this, new Crashlytics());
 defaultUEH = Thread.getDefaultUncaughtExceptionHandler();
 Thread.setDefaultUncaughtExceptionHandler(caughtExceptionHandler);
 } ApplicationΫϥε
  5. private static Thread.UncaughtExceptionHandler defaultUEH;
 private static Thread.UncaughtExceptionHandler caughtExceptionHandler =
 new

    Thread.UncaughtExceptionHandler() {
 @TargetApi(Build.VERSION_CODES.KITKAT) @Override
 public void uncaughtException(Thread thread, Throwable throwable) {
 // do something defaultUEH.uncaughtException(thread, throwable);
 }
 }; @Override public void onCreate() {
 super.onCreate();
 Fabric.with(this, new Crashlytics());
 defaultUEH = Thread.getDefaultUncaughtExceptionHandler();
 Thread.setDefaultUncaughtExceptionHandler(caughtExceptionHandler);
 } ApplicationΫϥε
  6. private static Thread.UncaughtExceptionHandler defaultUEH;
 private static Thread.UncaughtExceptionHandler caughtExceptionHandler =
 new

    Thread.UncaughtExceptionHandler() {
 @TargetApi(Build.VERSION_CODES.KITKAT) @Override
 public void uncaughtException(Thread thread, Throwable throwable) {
 // do something defaultUEH.uncaughtException(thread, throwable);
 }
 }; @Override public void onCreate() {
 super.onCreate();
 Fabric.with(this, new Crashlytics());
 defaultUEH = Thread.getDefaultUncaughtExceptionHandler();
 Thread.setDefaultUncaughtExceptionHandler(caughtExceptionHandler);
 } ApplicationΫϥε
  7. ·ͱΊ • UncaughtExceptionHandlerΛ࢖͑͹ΧελϚΠζͰ͖Δ • ଞͷCrash Reporting Tool͸ະௐࠪͳͷͰɺͲͳ͔ͨڭ͑ ͍ͯͩ͘͞ • Firebase

    Crash ReportingͰ͸ݸਓ৘ใʹؔΘΔ෦෼͸ ʮREDACTED_PERSONAL_IDENTIFICATION_NUMBER ʯʹͳΔΒ͍͠ɻ୭͔ڭ͍͑ͯͩ͘͞