title: Update ListView Widget with Application
body: <p>I have a problem with my App Widget when i try to update the content from my application. My widget contains a listview.</p>
  
  <p>The listview works fine and it updates every 30 minutes, but I also need to update it when i make changes in the application. Here is my code:</p>
  
  <pre><code>public class WidgetListProvider extends AppWidgetProvider {
  
      @Override
      public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
          final int N = appWidgetIds.length;
          ComponentName component;
          for (int i = 0; i &lt; N; ++i) {
              RemoteViews remoteViews = updateWidgetListView(context,
                      appWidgetIds[i]);
              appWidgetManager.updateAppWidget(appWidgetIds[i], remoteViews);
  
              component=new ComponentName(context,WidgetListProvider.class);
              appWidgetManager.notifyAppWidgetViewDataChanged(appWidgetIds, R.id.listViewWidget);
              appWidgetManager.updateAppWidget(component, remoteViews);
          }
  
          super.onUpdate(context, appWidgetManager, appWidgetIds);
      }
  
      private RemoteViews updateWidgetListView(Context context, int appWidgetId) {
          RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.widget_list_layout);
  
          Intent svcIntent = new Intent(context, WidgetService.class);
          svcIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
          svcIntent.setData(Uri.parse(svcIntent.toUri(Intent.URI_INTENT_SCHEME)));
          remoteViews.setRemoteAdapter(R.id.listViewWidget, svcIntent);
          remoteViews.setEmptyView(R.id.listViewWidget, R.id.empty_view);
          return remoteViews;
      }
  
  }
  </code></pre>