title: Widget ID and Intents
body: <p>I have set a widget up with <code>AppWidgetManager</code>, it has a <code>configure activity</code>, once I have pressed <code>done</code> on the activity, based on my selection the widget's appearance changes. And when the I tap on the widget, the <code>configure activity</code> is shown again. That's all fine and works, but if I kill the widget, using a third-party task manager, or Android's task list, (when you press the home button, and a list of apps appear), swiping away the <code>configure activity</code>, something really odd happens. I can tap on the Widget, and the <code>configure activity</code> shows, but when I press <code>done</code> on there, nothing happens on the widget. I need to remove the widget for it to work.</p>
  
  <pre><code>//Somewhere at the top (global variable)
  int mAppWidgetId = AppWidgetManager.INVALID_APPWIDGET_ID;
  
  ....
  
  Intent intent = getIntent();
  Bundle extras = intent.getExtras();
  if (extras != null) {
      mAppWidgetId = extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID);
  }
  
  if (mAppWidgetId != AppWidgetManager.INVALID_APPWIDGET_ID) {
      Intent resultValue = new Intent();
      resultValue.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, mAppWidgetId);
      setResult(RESULT_OK, resultValue);
  }
  
  finish();
  
  ....
  //Then in my Widget, I set the PendingIntent for tapping the RemoteViews
  Intent intent = new Intent(oContext, Widget_Configure.class);
  
  for (int c = 0; c &lt; oAppWidgetIds.length; c++){
       rv.setInt(R.id.widget_relative_layout, "setBackgroundColor", Color.argb(alpha, red, green, blue));             
       PendingIntent pendingIntent = PendingIntent.getActivity(oContext, oAppWidgetIds[c], intent, PendingIntent.FLAG_UPDATE_CURRENT );                           
  
       rv.setOnClickPendingIntent(R.id.borderBottomLeft, pendingIntent);
       rv.setOnClickPendingIntent(R.id.borderBottomRight, pendingIntent);
       rv.setOnClickPendingIntent(R.id.borderTopLeft, pendingIntent);
       rv.setOnClickPendingIntent(R.id.borderTopRight, pendingIntent);
       rv.setOnClickPendingIntent(R.id.widget_relative_layout, pendingIntent);
  
       oAppWidgetManager.updateAppWidget(oAppWidgetIds[c], rv);
  }
  
  //oContext is global Context, when Widget starts oContext is set to `this`;
  </code></pre>
  
  <p>How can I make it so that, I don't have to remove the widget, even though the widget is killed, and make it restart itself, if possible.</p>
  
  <p>Thanks.</p>