Re: [android-developers] Prevent multiple copies of an Android service

2012-03-02 Thread Mark Murphy
On Thu, Mar 1, 2012 at 11:51 PM, Alan Smith gpsanima...@gmail.com wrote: The doco for startService states If this service is not already running, it will be instantiated and started (creating a process for it if needed); if it is running then it remains running. I'm finding that each call to

Re: [android-developers] Prevent multiple copies of an Android service

2012-03-02 Thread Alan Smith
Thanks. I had my code in the onHandleIntent() method, so it was, as you suggest, being executed on each call to startService. I've now got my code in the onCreate method and things are moving forward. On Fri, Mar 2, 2012 at 11:49 PM, Mark Murphy mmur...@commonsware.comwrote: On Thu, Mar 1,

[android-developers] Prevent multiple copies of an Android service

2012-03-01 Thread Alan Smith
The docohttp://developer.android.com/reference/android/content/Context.html#startService%28android.content.Intent%29 for startService states If this service is not already running, it will be instantiated and started (creating a process for it if needed); if it is running then it remains running.