Best practice for error handling in an Android Service

Posted by Omar Kohl on Stack Overflow See other posts from Stack Overflow or by Omar Kohl
Published on 2012-10-28T12:42:32Z Indexed on 2012/10/28 17:01 UTC
Read the original article Hit count: 292

I have an Android Service that does some background processing on an image using a separate Thread. If an error occurs in this Service or even worse in the thread, what is the best practice to inform the launching Activity of the problem and allow the application to recover to a stable state (i.e. the state it was in before launching the service).

From within the Service I could post a Toast or a Notification, but that doesn't help me. I would like to inform the user about the problem but at the same time recover the application to a stable state.

© Stack Overflow or respective owner

Related posts about android

Related posts about exception