title: Android singleton over several services
body: <p>I have a problem with my singleton class that is used by services. The singleton is called by 2 services to make a notification. The singleton counts 2 variables for the 2 services.</p>
  
  <p>The problem is:</p>
  
  <p>One counter is only incremented by first services and the second variable by other services though it's a singleton which holds the 2 variables. I don't understand why the two services have different instances of the singleton.</p>
  
  <pre><code>public static synchronized NotificationSingleton getInstance() {
  
      if (mInstance == null) {
        mInstance = new NotificationSingleton();
      } 
      return mInstance;
  }
  </code></pre>
  
  <p>This should return the one and only instance of the singleton. </p>