Oops not finished.

I made these changes in the Thread run method.

          // Get android default exceptions handler
          Thread.UncaughtExceptionHandler orgHandler =
                Thread.getDefaultUncaughtExceptionHandler();
          // Register default exceptions handler
         Thread.setDefaultUncaughtExceptionHandler(
                 new DefaultExceptionHandler(orgHandler));

On Apr 27, 2:45 pm, Glen Humphrey <glendon.humphr...@gmail.com> wrote:
> I made some changes to your exception handler so that the user will
> see the standard force close dialog on unhandled exceptions.  What I
> am doing is getting the default android handler and passing it to the
> your default handler so that it can call the android handler after it
> is done.  This is not the solution I would
> like to have, but I think it is better than having no error dialog.
>
> In DefaultExceptionHandler.java I made these changes:
>
>         private Thread.UncaughtExceptionHandler mOrgHandler;
>
>         DefaultExceptionHandler(Thread.UncaughtExceptionHandler orgHandler) {
>                 mOrgHandler = orgHandler;
>         }
>
> // commented this out as the android handler seems to do this.
>                 //t.getThreadGroup().destroy();
>
> //added this at the end of the uncaughtException method
>                 // call the original uncaught exception handler
>                 mOrgHandler.uncaughtException(t, e);
>
> On Mar 17, 2:44 pm, Mads Kristiansen <mads.kristian...@nullwire.com>
> wrote:
>
> > Well, I am using a workaround currently, which means that the application
> > will restart. On application restart a dialog will then notify the user that
> > a problem has occurred.
> > The problem here is that I cannot get a context in the default exception
> > handler (where I dump the stack trace) and thus I am not able to display a
> > dialog. Does anybody know if I can "steal" a system context from somewhere?
> > I couldn't find anything helpful in the documentation about this.
>
> > I'll see if I can come up with something better.
>
> > Best regards, Mads Kristiansen
>
> > On Tue, Mar 17, 2009 at 9:55 PM, cnordvik <cnord...@gmail.com> wrote:
>
> > > > 1) When an exception occurs, the application will just drop back to the
> > > home
> > > > screen and the user won't actually know that an exception has occured.
>
> > > Any luck on sorting this out? A dialog that informs the user of the
> > > error and a "report this problem" button that opens the email app
> > > would be really nice :-)
>
> > > -Christer
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to