views:

68

answers:

2

I'm working with the emulator using the debugger and I've noticed that onUpdate is not getting called. When I add the widget to the emulator homescreen I see my breakpoint being hit in the onReceive method. The onReceive method does get the android.appwidget.action.APPWIDGET_UPDATE intent. However, the onUpdate function never gets called. I believe it's defined correctly.

    @Override
        public void onUpdate(Context context
,AppWidgetManager appWidgetManager,int[] appWidgetIds)
        {
    // code that sets up remove view and updates appWidgetManager


    }
A: 

Do you have a configuration activity setup for your widget? Because if you do, then onUpdate is not called and it is the job of the configuration activity to manually update the widget for the first time. After that onUpdate should be called as defined in your updatePeriod configuration.

Shantanu Goel
Yes I read that as well, but in thi scase I'm not using a configuration activity and don't have one specified
JonF
A: 

Do you have this in the Android Manifest?

       <intent-filter>
   <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
  </intent-filter>
JeffC