title: android widget after onDelete still listening
body: <p>I have a Service that calls some update-methods in a <code>GameLogic</code>-singleton. The<code>GameLogic</code> may decide that some status-update is needed. In this case it informs its listeners about a <code>StatusUpdateEvent</code>. The listeneres then update their view etc.</p>
  
  <pre><code>public class GameLogic {
      // ... attributes ...
      private static GameLogic instance = null;
      private GameLogic() {
          // singleton pattern
      }
      public static synchronized GameLogic getInstance() {
          if (instance == null) {
              instance = new GameLogic();
          }
          return instance;
      }
      public void checkStatus() {
          // called by service
          // ... some checks
          notifyStatusUpdate(new StatusUpdateEvent());
      }
      public void addStatusUpdateListener(StatusUpdateListener listener) {
          if (!listeners.contains(listener)) {
              listeners.add(listener);
          }
      }
      public void removeStatusUpdateListener(StatusUpdateListener listener) {
          listeners.remove(listener);
      }
      protected synchronized void notifyStatusUpdate(StatusUpdateEvent event) {
          for (StatusUpdateListener l : listeners) {
              l.onStatusUpdate(event);
          }
      }
  }
  </code></pre>
  
  <p>I have a widget that should listen to the <code>StatusUpdateEvent</code>:</p>
  
  <pre><code>public class ProjectWidget extends AppWidgetProvider implements StatusUpdateListener {
      // ... attributes ...
      @Override
      public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
          this.context = context;
          this.appWidgetManager = appWidgetManager;
          this.remoteViews = new RemoteViews(context.getPackageName(), R.layout.widget_2x1);
          this.thisWidget = new ComponentName(context, ProjectWidget.class);
  
          GameLogic.getInstance().addStatusUpdateListener(this);
      }
  
      @Override
      public void onDeleted(Context context, int[] appWidgetIds) {
          Toast.makeText(context, "onDeleted", Toast.LENGTH_SHORT).show();
          GameLogic.getInstance().removeStatusUpdateListener(this);
          super.onDeleted(context, appWidgetIds);
      }
      @Override
      public void onStatusUpdate(StatusUpdateEvent e) {
          android.util.Log.d("ProjectWidget", "onStatusUpdate");
          // here some class fields are updated like this.project = e.getProject();
          // ...
          updateViews();
          appWidgetManager.updateAppWidget(thisWidget, remoteViews);
      }
      // ... updateViews() etc.
  }
  </code></pre>
  
  <p>But the problem now is:
  I add the widget to the homescreen, everythings fine. Then if I delete the widget from the homescreen, I see the onDelete Toast, but afterwards I still see that Log entry: ProjectWidget onStatusUpdate.</p>
  
  <p>So the listener is not removed.. why? and how can I do that stuff?</p>
  
  <p>Thanks!</p>