I have an Android Widget that uses web services to retrieve and display the data on the widget. The widget has a configuration activity that extends PreferenceActivity
From android documentation: http://developer.android.com/guide/topics/appwidgets/index.html#Configuring
The onUpdate() method will not be called when the App Widget is created (the system will not send the ACTION_APPWIDGET_UPDATE broadcast when a configuration Activity is launched). It is the responsibility of the configuration Activity to request an update from the AppWidgetManager when the App Widget is first created. However, onUpdate() will be called for subsequent updates—it is only skipped the first time.
HOWEVER, this does not seem to be correct!
What I did was adding a boolean to SharedPreferences which tells me if this widgetId has been through configuration. If not skip this update. Implement this in your AppWidgetProvider class' onUpdate method.
Declare ActivityConfig in manifest:
<activity
android:name="com.zoostudio.moneylover.widget.ActivityWidgetConfig"
android:label="Hello Widget Config">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
</intent-filter>
</activity>
With update widget class:
public abstract class SampleWiget extends AppWidgetProvider {
}
follow android developer widget support to understand it.