title: Update AppWidget from within program?
body: <p>I need to update my AppWidget when my main activity pauses.  I tried using the following code in my main activity's onPause():</p>
  
  <pre><code>super.onPause();
  AppWidgetManager manager = AppWidgetManager.getInstance(this);
  int[] a = manager.getAppWidgetIds(new ComponentName(this, "WidgetProvider"));
  new WidgetProvider().onUpdate(this, manager, a);
  </code></pre>
  
  <p>When I call this code, however, <code>a</code> is empty.  What am I doing wrong?</p>