title: Android service isn't working as a singleton
body: <p>I have a service that is being used/bound in multiple activities (I carefully wrote it so that one activity will unbind it before another binds, in onPause/onResume). However, I noticed a member in the Service won't stick....</p>
  
  <p>Activity 1:</p>
  
  <pre><code>private void bindService() {
      // Bind to QueueService
      Intent queueIntent = new Intent(this, QueueService.class);
      bindService(queueIntent, mConnection, Context.BIND_AUTO_CREATE);
  }
  
  ...
  
  bindService();
  
  ...
  
  mService.addItems(downloads);     // the initial test adds 16 of them
  </code></pre>
  
  <p>Activity 2:</p>
  
  <pre><code>bindService();                             // a different one than activity 1
  int dlSize = mService.getQueue().size();   // always returns 0 (wrong)
  </code></pre>
  
  <p>Service's code:</p>
  
  <pre><code>public class QueueService extends Service {
      private ArrayList&lt;DownloadItem&gt; downloadItems = new ArrayList&lt;DownloadItem();
  
      // omitted binders, constructor, etc
  
      public ArrayList&lt;DownloadItem&gt; addItems(ArrayList&lt;DownloadItem&gt; itemsToAdd) {
          downloadItems.addAll(itemsToAdd);
          return downloadItems;
      }
  
      public ArrayList&lt;DownloadItem&gt; getQueue() {
          return downloadItems;
      }
  }
  </code></pre>
  
  <p>Upon changing one thing -- making the service's downloadItems variable into a static one -- everything works perfectly. But having to do that worries me; I've never used a singleton in this way before. Is this the correct method of using one of these?</p>