Image the following scenario:
I've got an Android application which talks to an API
across multiple activities. I'm using a self-written "Authenticator
" class to ensure that I always have a valid session. But it's nevertheless possible, that the authentication fails.
Now to my question:
Is there a slick way to handle an "UnauthenticatedException
" my Authenticator may throw by forwarding to an LoginActivity
without having to write the same try-catch in every API-talking activity and without making the Authenticator context-aware?