Yea, I've definitely considered that option. I suppose my whole reason for this is to avoid needing to handle an error from the utility class in each of my activities.
My application is one main TabActivity that contains 4 tabs, each being it's own activity. You've made me realize that it might be possible for me to have the activities request authentication from the main TabActivity, which would be responsible for starting the login activity. In which case I would only need the main TabActivity to handle the login activity's response. Does this sound like a logical design? Sorry for being an idiot, I'm still trying to get a hold on the Android framework... On May 4, 12:25 pm, TreKing <[email protected]> wrote: > 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 > deviceshttp://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 > athttp://groups.google.com/group/android-developers?hl=en -- 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

