I have an android widget which is updated 1 time per day (as stated in the providerinfo.xml file).
Here is, currently, my onUpdate method:
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds)
{
RemoteViews rvs = new RemoteViews(context.getPackageName(), R.layout.main);
rvs.setTextViewText(R.id.textviewquote, "we updated! yay!");
appWidgetManager.updateAppWidget(new ComponentName(context, main.class), rvs);
}
However, my textview NEVER changes. onUpdate is called at the beginning, when the widget is first created right? So how does one actually change the text in a textview?
Thanks
Edit:
Provider Info:
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:minWidth="294dp"
android:minHeight="72dp"
android:updatePeriodMillis="86400000"
android:initialLayout="@layout/main">
And Manifest:
<receiver android:name=".main" >
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data android:name="android.appwidget.provider"
android:resource="@xml/appwidgetproviderinfo" />
</receiver>
Update:
The Method onUpdate() is not even getting called. Can someone tell me why?
Major Update: In android 2.3, the onUpdate() method is NOT called, but in android 2.2, it IS called. I wonder if this is a bug, or perhaps they changed the way widgets work.
Check my updates:
Major Update: In android 2.3, the onUpdate() method is NOT called, but in android 2.2, it IS called. I wonder if this is a bug, or perhaps they changed the way widgets work.
I’m accepting this as the answer. We’ll see if google does anything about it.