title: Android - Multiple appWidgets playing different sounds
body: <p>I'm writing an android soundboard which allow the user to create multiple desktop widgets, one for each sound. I'm using an activity for the user to choose which sound he wants to create the widget for. For each widget created I store a  shared preference in the form of</p>
  <pre><code>key =&gt; &quot;WIDGET_FILENAME_&quot;+widgetId, value=&gt; fileName
  </code></pre>
  <p>To play the sounds, I did override the <code>onRecieve</code> method on the widgetProvider class. When the desktop widget is clicked, it triggers a broadcast to this method, which gets the widget id from the intent and then loads the shared preference associated with the widget:</p>
  <pre><code>int appWidgetId =  intent.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID,
                                       AppWidgetManager.INVALID_APPWIDGET_ID);
  </code></pre>
  <p>The problem is: The widgetId is always the same, no matter which widget is clicked, causing the same sound to be played.</p>
  <p>Any idea or guidance on this?</p>