title: android update widget from broadcast receiver
body: <p>I have an widget and I must update the widget when action <code>android.media.RINGER_MODE_CHANGED</code> occurs. I have the folowing broadcast receiver:</p>
  
  <pre><code>public void onReceive(Context context, Intent intent) {
          AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context.getApplicationContext());
          ComponentName thisWidget = new ComponentName(context.getApplicationContext(), ExampleAppWidgetProvider.class);
          int[] appWidgetIds = appWidgetManager.getAppWidgetIds(thisWidget);
          if (appWidgetIds != null &amp;&amp; appWidgetIds.length &gt; 0) {
              for (int widgetId : appWidgetIds) {
                  RemoteViews remoteViews = new RemoteViews(context
                          .getApplicationContext().getPackageName(),
                          R.layout.widget1);
                  appWidgetManager.updateAppWidget(widgetId, remoteViews);
              }
          }
      }
  </code></pre>
  
  <p>and this si code for my widget</p>
  
  <pre><code>public class ExampleAppWidgetProvider extends AppWidgetProvider {
      DateFormat df = new SimpleDateFormat("hh:mm:ss");
  
      public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
          final int N = appWidgetIds.length;
          for (int i = 0; i &lt; N; i++) {
              int appWidgetId = appWidgetIds[i];
              //my pudate widget code
              appWidgetManager.updateAppWidget(appWidgetId, views);
          }
      }
  }
  
  &lt;receiver android:name=".ExampleAppWidgetProvider" android:label="demo widget"&gt;
    &lt;intent-filter&gt;
          &lt;action android:name="android.appwidget.action.APPWIDGET_UPDATE" /&gt;
    &lt;/intent-filter&gt;
    &lt;meta-data android:name="android.appwidget.provider" android:resource="@xml/widget1_info" /&gt;
  &lt;/receiver&gt;
  </code></pre>
  
  <p>so my problem is that even if the instruction <code>appWidgetManager.updateAppWidget(widgetId, remoteViews);</code> from my broadcast receiver is executed, the update method inside the widget is not executed. Does anybody knows why?</p>