I am making an Android widget to display real time transportation information based on bus stop numbers. It displays the next 3 bus arrivals for the stop number and has a button where the user can refresh the data. That was working ok until I tried adding my widget configuration activity.

Now when you select the widget, a configuration screen is opened where you enter your bus stop number. Once you do that the widget is added to the home screen, but it will not execute the method to gather data and the refresh button will not work for that either. I have not been able to figure out why.

public class MyWidgetProvider extends AppWidgetProvider {
@Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds){
RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.widget_layout);
// Create a new intent that will target this class
Intent intent = new Intent(context, MyWidgetProvider.class);
intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetIds[0]);
intent.setAction("update");
// Create a new PendingIntent which will be run whenever the refresh button is pressed
// This PendingIntent will run the intent we just created before this
PendingIntent pi = PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
remoteViews.setOnClickPendingIntent(R.id.button1, pi);
// Manually run the AsyncTask to initially populate the 5 question fields
new RTPIinformation().execute(context);
appWidgetManager.updateAppWidget(appWidgetIds, remoteViews);
}
// This method is called when it receives an Intent. In particular, it will
// receive an intent whenever the refresh button is clicked
@Override
public void onReceive(Context context, Intent intent){
super.onReceive(context, intent);
if (intent.getAction().equals("update")){
new RTPIinformation().execute(context);
}
}
class RTPIinformation extends AsyncTask<Context, Void, List<RealtimeData>>{
.
.
.
}