title: How to manually call `onUpdate` from within the widget itself
body: <pre><code>public class VWid extends AppWidgetProvider {
  
      public static String WIDGET_UPDATE = "WIDGET_UPDATE";
  
      @Override
      public void onReceive(Context context, Intent intent) {
          super.onReceive(context, intent);
  
          if (WIDGET_UPDATE.equals(intent.getAction())) {
              Toast.makeText(context, "onReceiver()", Toast.LENGTH_LONG).show();
          }
      }
  
      public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
          final int N = appWidgetIds.length;
  
          // Perform this loop procedure for each App Widget that belongs to this
          // provider
          for (int i = 0; i &lt; N; i++) {
              int appWidgetId = appWidgetIds[i];
              int k, p;
              SimpleDateFormat dateFormat = new SimpleDateFormat("MM-dd-yyyy hh:mm a");
  
              AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
              int k = audioManager.getStreamVolume(AudioManager.STREAM_SYSTEM);
              Toast.makeText(getActivity(), k+"", Toast.LENGTH_LONG).show();
  
              Intent imageview2Intent= new Intent(context, VWid.class);
              PendingIntent pendingIntent2= PendingIntent.getBroadcast(context,0, imageview2Intent,0);
  
              views.setOnClickPendingIntent(R.id.imagebuttonrefresh, pendingIntent2); //
  
              views.setTextViewText(R.id.textview1, "Last Refresh: " + dateFormat.format(new Date()).toString());
  
              pushWidgetUpdate(context, views);
          }
      }
  
      public static void pushWidgetUpdate(Context context, RemoteViews remoteViews) {
          ComponentName myWidget = new ComponentName(context, VWid.class);
          AppWidgetManager manager = AppWidgetManager.getInstance(context);
          manager.updateAppWidget(myWidget, remoteViews);
          Log.d("UPDATED", "testing");
      }
  }
  </code></pre>
  
  <p>When I first add the widget to my homescreen, <code>textview1</code> displays: <code>Last Refresh: {current date and time}</code>. It also displays the system volume in a Toast.</p>
  
  <p>Let's say I increase/decrease the system volume, when I hit refresh the <code>onUpdate()</code> function should fire showing the updated Toast and also updating the <code>textview1</code> text to the new data and time but that's not happening.</p>
  
  <p>How can I modify the code so I can achieve a refresh, in essence calling the <code>onUpdate()</code> function.</p>