actually I had a question regarding this... I made a service which plays an MP3, so it uses a single instance (in the whole service) of MediaPlayer.. Still I noticed (by mistake because the Service didn't get closed while exiting my main Activity) that the Service obviously kept running, but when I restarted my app it created another Service which also could play the MP3, thus creating a "mixing" effect, having the same MP3 playing double... The second one I could stop through my App but the first "lost" one couldn't be stopped... To me this doesn't look like a Singleton's behaviour, I actually have two seperate entities of a Service running in the system... Also, a little question, I use the onBind() method and the .aidl interface methology to create my Service... Is there a correct way to stop a Service ? And if so where should this be implemented (for example unBind() in the onDestroy() method of my main Activity) ? Thanks in advance Mark (or anyone who might shed some light on my issue) !
On 11 feb, 17:11, "Mark Murphy" <[email protected]> wrote: > > I'd like to know if it's possible to create a Singelton Service > > throughout an application ? > > Services are singletons by their very nature. > > -- > Mark Murphy (a Commons Guy)http://commonsware.com > Android App Developer Books:http://commonsware.com/books.html -- 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

