title: Intent service singleton
body: <p>I want to implement a <code>Service</code> that acts like a <code>Singleton</code>.</p>
  
  <p>I need my App to check if the screen is locked, then start a <code>Listener</code> <code>IntentService</code>. If the screen becomes unlocked, it will kill the <code>Listener</code> service.
  I created a <code>ScreenLockService</code> that is an <code>IntentService</code> and is called by the <code>Home</code> activity if the user checked the on/off box because I want the <code>Listener</code> to run even if the the App isn't running.</p>
  
  <p>So the <code>Home</code> activity runs and stops the <code>ScreenLockService</code> service which will run and stop the <code>Listener</code> service.</p>
  
  <p>My problem is that the <code>Home</code> <code>Activity</code> creates multiple instances of <code>ScreenLockService</code> which also creates multiple instances of <code>Listener</code>.</p>
  
  <p>So I'd like to have these two <code>IntentServices</code> run as <code>Singletons</code>, but I'm not sure how to do so.</p>
  
  <p>I've checked out a bunch of tutorials, but they're either out dated or not tailored to IntentServices such as:
  <a href="http://www.devahead.com/blog/2011/06/extending-the-android-application-class-and-dealing-with-singleton/" rel="nofollow noreferrer">http://www.devahead.com/blog/2011/06/extending-the-android-application-class-and-dealing-with-singleton/</a>
  <a href="https://stackoverflow.com/questions/16517702/singleton-in-android">Singleton in Android</a></p>
  
  <p>I can post some example code of what I have if necessary, but all I'm really looking for is a how-to. </p>