Just invoke Activity.getApplication() within your Activity.onCreate method, casting the Application to your specific class type. Then your can set whatever you need on your application instance and it will be accessible within other Activities through the same Activity.getApplication() method.
http://developer.android.com/reference/android/app/Activity.html#getApplication On Fri, Jul 30, 2010 at 10:29 AM, Priyank <[email protected]> wrote: > Hi, > I had a basic question. > Can my class extend 2 or more classes at a time. What is the syntax. > I want to extend Activity as well as Application. Wont this create > problems in the manifest file? > Activity because, I need to do a couple of things during the > onCreate() [binding a service]and Application, because I am creating > objects of another class [service class]which needs to be accessible > throughout my application. > > > Thanks, > Priyank > > -- > 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 -- Shane Isbell (Founder of ZappMarket) http://apps.facebook.com/zappmarket/ -- 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

