I'm new to Android development and am working on a small test project.
I have a service, which communicates with an SQLite3 database, and two
activities. A main activity which fetches database information via the
service and displays it and a second activity which allows me to add
data to the database via the service.

Currently, I have a singleton class which implements the
ServiceConnection interface and I'm binding this to the service in the
the main activity using the bindService function. Because it's a
singleton, I can then use this service connection in both the main
activity and second activity to work with the database and it all
seems to work quite well.

However, I'm all the time aware that the service connection is bound
to the main activity and I'm wondering if this is the wrong/bad way to
do it? Would I be best off having two service connections, one in each
activity, and binding each to the service?

-- 
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

Reply via email to