androiderror-handlinguser-customization

unfortunately closed message customization in android


I want my own message should be showed when my app crashes or stopped working. Or when app crashes,any other activity should be displayed.In that time an Intent should be called

link

Refer the above link.


Solution

  • USE DefaultUncaughtExceptionHandler

    Public class YOURAPPLICATION extends Application
        {
          public void onCreate ()
          {
            // Setup handler for uncaught exceptions.
            Thread.setDefaultUncaughtExceptionHandler (new Thread.UncaughtExceptionHandler()
            {
              @Override
              public void uncaughtException (Thread thread, Throwable e)
              {
                handleUncaughtException (thread, e);
              }
            });
          }
    
          public void handleUncaughtException (Thread thread, Throwable e)
          {
    
           //CREATE YOUR ACTIVITY HERE.
    
    
          }