title: Observable/Observer not working?
body: <p>I tried implementing a static Observable in my Application subclass, but it's not working. No exceptions or error messages, but my update() callback doesn't get called. </p>
  
  <p><strong>MyApplication.java</strong></p>
  
  <pre><code>public class MyApplication extends Application{
      public static Observable appObserver = new Observable();
  
      public void onCreate(){
          super.onCreate();        
      }
  
  }
  </code></pre>
  
  <p><strong>Foo.java</strong></p>
  
  <pre><code>MyApplication.appObserver.notifyObservers( "Hello world" );
  </code></pre>
  
  <p><strong>BarFragment.java</strong></p>
  
  <pre><code>public class BarFragment extends Fragment implements Observer{
  
      @Override
      public void onActivityCreated(Bundle savedInstanceState) {
          super.onActivityCreated(savedInstanceState);                
          MyApplication.appObserver.addObserver(this);
      }
  
  
      @Override
      public void onDestroy() {       
          MyApplication.appObserver.deleteObserver(this);
          super.onDestroy();
      }
  
  
      @Override
      public void update(Observable observable, Object data) {
          Log.i("BarFragment", data.toString()); // Should log, but doesn't
      }
  
  }
  </code></pre>
  
  <p>What's more, I tried scribbling down a simple Observable of my own, and then everything worked like a charm with just substituting <code>public static Observable appObserver = new Observable();</code> with <code>public static MyObservable appObserver = new MyObservable();</code></p>
  
  <p><strong>MyObservable.java</strong></p>
  
  <pre><code>public class MyObservable {
      protected List&lt;Object&gt; observers = new ArrayList&lt;Object&gt;();
  
      public void addObserver(Object observer){
          observers.add(observer);
      }
  
      public void notifyObservers(Object data){
          for( int i=0; i&lt;observers.size(); i++ ){
              ((Observer) observers.get(i)).update(null, data);
          }
      }
  }
  </code></pre>
  
  <p>What am I missing?</p>
  
  <p>I'm testing this on a Nexus One  with Android 2.3.6 if it matters.</p>