If you have a Context reference in this code, you can call: myContext.startActivity(...)
Might want to set FLAG_ACTIVITY_NEW_TASK flag in the intent to avoid a logcat warning when it's added by the framework. -- Kostya Vasilyev -- http://kmansoft.wordpress.com 14.01.2011 16:21 пользователь "Tux" <[email protected]> написал: > Hi all, > > I have a class extending IPackageManager.Stub (does not really matter > here), the point is, I need to start an activity from this class. > > I cannot do: > > Intent i = new Intent(); > i.setComponent(new ComponentName(<packageNameString>, > <fullyQualifiedClassNameOfActivity> )); > startActivity(i); > > as my class is not an activity. > > How can I do that? Btw i know I can pass the instance of the calling > activity of the non-activity class as a parameter, but I need > something else for design purposes. > > So, to be clear, How can I call an activity from a non-activity > class? > > > > -- > 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]<android-developers%[email protected]> > 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 [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

