title: Android Home screen Widget: RemoteViews setRemoteAdapter(...) method not working on API 11+
body: <p>So onUpdate method calls </p>
  
  <p><code>remoteViews.setRemoteAdapter(id, R.id.listview, intent)</code></p>
  
  <p>in order to apply an adapter to the listview in the widget.</p>
  
  <p>There is a button in the header of the widget which can change which data set is displayed by the listview (think inbox, outbox, starred, etc for a hypothetical email widget). When I click that button, it takes the user to an Activity which allows them to choose which data set to display. When the selection is made, the following code is run:</p>
  
  <pre><code>Intent intent = new Intent(this, WidgetReceiver.class);
  intent.setAction("android.appwidget.action.APPWIDGET_UPDATE");
  intent.putExtra("notify", true);
  intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, new int[] {R.xml.widget_provider});
  sendBroadcast(intent);
  </code></pre>
  
  <p>This successfully calls the onUpdate method in the widget's AppWidgetProvider class. However, if I were to toggle between different types of data sets, after like 2-3 preference changes, the <code>setRemoteAdapter</code> method simply stops functioning. I have extensively logged the process, and the method, which is supposed to call a service which in turn loads up the <code>RemoteViewsService.RemoteViewsFactory</code> class to populate the widget and its adapter, does not do any of these things. The first couple times you change the preference, it works as expected. But afterwards it quits.</p>
  
  <p>Does anyone have any clue what is going on here?</p>