[android-developers] Is it possible to start an Activity from a non-context class?
For example, I have an activity that uses a utility class. I would like to be able to start an activity from the utility class and have the activity result sent back to the utility class. The only way I could think of starting the activity was to pass the original activity to the utility class, so that the utility class could use the original activity to start the activity. The problem with this is that the activity is sent to the original activity, rather than the utility class. I also thought of actually making the utility class an activity itself, but that would make using the utility class much more complicated. Thanks for any advice! -- 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
Re: [android-developers] Is it possible to start an Activity from a non-context class?
On Tue, May 4, 2010 at 2:02 AM, Michael J txaggiemich...@gmail.com wrote: For example, I have an activity that uses a utility class. I would like to be able to start an activity from the utility class and have the activity result sent back to the utility class. Why are you doing this? What purpose is your utility class serving that it requires starting and retrieving data from another 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 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
Re: [android-developers] Is it possible to start an Activity from a non-context class?
just pass your context over to the utility class via getter/setter or in constructor... Am 04.05.2010 17:40, schrieb TreKing: On Tue, May 4, 2010 at 2:02 AM, Michael J txaggiemich...@gmail.com mailto:txaggiemich...@gmail.com wrote: For example, I have an activity that uses a utility class. I would like to be able to start an activity from the utility class and have the activity result sent back to the utility class. Why are you doing this? What purpose is your utility class serving that it requires starting and retrieving data from another 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 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 -- 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
Re: [android-developers] Is it possible to start an Activity from a non-context class?
On Tue, May 4, 2010 at 10:42 AM, Timo Prill timo.pr...@googlemail.comwrote: just pass your context over to the utility class via getter/setter or in constructor... And how is that different than what the OP has already tried (passing the Activity itself)? - 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 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