title: Widget Wont Update / Redraw
body: <p>I have a widget that loaded image from SQLite. It updated whenever I add or delete item but the image is not updated. I already try to send a broadcast to AppWidgetProvider class but it didn't work too.</p>
  
  <blockquote>
    <p>class that extend AppWidgetProvider</p>
  </blockquote>
  
  <pre><code>private static void updateAppWidget(Context context, AppWidgetManager appWidgetManager, int appWidgetId) {
      Intent intent = new Intent(context, StackWidgetService.class);
      intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
      intent.setData(Uri.parse(intent.toUri(Intent.URI_INTENT_SCHEME)));
  
      RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.fav_movie_widget);
      views.setRemoteAdapter(R.id.stack_view, intent);
      views.setEmptyView(R.id.stack_view, R.id.empty_view);
  
      Intent toastIntent = new Intent(context, FavMovieWidget.class);
      toastIntent.setAction(FavMovieWidget.TOAST_ACTION);
      toastIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
  
      intent.setData(Uri.parse(intent.toUri(Intent.URI_INTENT_SCHEME)));
      PendingIntent toastPendingIntent = PendingIntent.getBroadcast(context, 0, toastIntent, PendingIntent.FLAG_UPDATE_CURRENT);
      views.setPendingIntentTemplate(R.id.stack_view, toastPendingIntent);
  
      appWidgetManager.updateAppWidget(appWidgetId, views);
      Log.e(TAG, "onUpdate2: start" );
  }
  
      @Override
      public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
          Log.e(TAG, "onUpdate: start" );
          for (int appWidgetId : appWidgetIds) {
              updateAppWidget(context, appWidgetManager, appWidgetId);
          }
      }
  </code></pre>
  
  <blockquote>
    <p>activity for update</p>
  </blockquote>
  
  <pre><code>Context context = getApplicationContext();
  AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);
  ComponentName thisWidget = new ComponentName(context, FavMovieWidget.class);
  int[] appWidgetIds = appWidgetManager.getAppWidgetIds(thisWidget);
  appWidgetManager.notifyAppWidgetViewDataChanged(appWidgetIds, R.id.stack_view);
  </code></pre>
  
  <blockquote>
    <p>what i already try</p>
  </blockquote>
  
  <pre><code>Intent intent = new Intent(this, FavMovieWidget.class);       
  intent.setAction(appWidgetManager.ACTION_APPWIDGET_UPDATE);
  int[] ids = appWidgetManager.getAppWidgetIds(new ComponentName(getApplication(), FavMovieWidget.class));
  intent.putExtra(appWidgetManager.EXTRA_APPWIDGET_IDS, ids);
  sendBroadcast(intent);
  </code></pre>
  
  <blockquote>
    <p>the widget image not update
    <a href="https://i.stack.imgur.com/GGLIa.png" rel="nofollow noreferrer">preview widget</a></p>
  </blockquote>