On Tue, May 4, 2010 at 11:56 AM, Michael J <[email protected]> wrote:

> In my application, I'm referencing a RESTful web service which
> requires token authentication.  My utility class is simply a utility
> for sending a REST request.  If the request responds with an invalid
> authentication message, I would like the utility to be able to
> initiate a LogIn activity to request a new authentication from the
> user.  Once the LogIn activity has completed, I would like the utility
> class to be able to handle the LogIn activity's result, and attempt
> the request again.
>

It sounds to me like you're giving this utility class a responsibility it
should not have. If it's purpose is to send requests (and report back
errors) then that's all it should do.

I don't know how you've set up your code, but I would expect a main activity
that is responsible for doing the request using the utility class. If that
fails (which the utility class would report), the calling activity would
then launch the login activity to get the details, which you would get back
in onActivityResult, which the main activity would then pass on to the
utility class to try the request again.

Again, I don't know the details of your code, but I don't see why this class
would need to start and get results from an activity.

-------------------------------------------------------------------------------------------------
TreKing - Chicago transit tracking app for Android-powered devices
http://sites.google.com/site/rezmobileapps/treking

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to