1

I have an API Object that I made, and I would like to share it between a running Service and various Activities in my app, almost like if I was to make the class static. How could I go about sharing the created object between the two?

Chiggins
  • 8,197
  • 22
  • 56
  • 81

2 Answers2

1

You may find the following helpful.

Binding a Service to an android.app.Activity vs Binding it to an android.app.Application

Android Service interacting with multiple activities

Alternatives for Pushing data from an Android Service to an Activity

Community
  • 1
  • 1
Soumya Simanta
  • 11,523
  • 24
  • 106
  • 161
  • 1
    Ha ha awesome. I love it when the answer is along the lines of "I'm not trying to be a jerk, but I am going to politely point out that a quick search could likely have been all you needed" – Hamy Aug 08 '10 at 04:35
0

I figured out the best way to do this is to have a class that holds all the information that you want, and to use that class through each activity and service.

Chiggins
  • 8,197
  • 22
  • 56
  • 81