title: The setOnClickPendingIntent() does not work on existing widgets after device boots up
body: <p>I have a widget which is supposed to react on click/tap events, and it does work perfectly until I reboot the device/emulator.</p>
  
  <p>After a reboot, I have to manually remove all the widget instances from the screen and re-add them to make them react on events again.</p>
  
  <p>The code below is called both in the onEnabled()- and onUpdate()-methods. And I double checked that all lines of the code is executed in both methods during device startup.</p>
  
  <pre><code>public void doSetUpClickIntent( Context context )
  {
   PendingIntent pendingIntent = UtilityClass.doCreateIntent( context );
   if ( pendingIntent != null )
   {
    ComponentName componentName = new ComponentName(context, WidgetProvider.class );
    AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);
    int [] appWidgetIds = appWidgetManager.getAppWidgetIds(componentName);
    for ( int appWidgetId : appWidgetIds )
    {
     RemoteViews views = new RemoteViews( context.getPackageName(), R.layout.widget );
     views.setOnClickPendingIntent( R.id.widgetlayout, pendingIntent );
     appWidgetManager.updateAppWidget( appWidgetId, views );
    }
   }
  }
  </code></pre>
  
  <p>I am at loss to find a cause. What am I doing wrong?</p>
  
  <p>Thank you.</p>