Application has widget which basically shows the number of new message
count in the widget. Widget has title and Count.When application gets
updated, widget title gets replaced with message count, and some times
it shows problem loading widget. seems like R value not updated after
app update. However user removes the application or reboot the phone
widget icon shows properly. Is there any way to fix the issue?

Any suggestions.Here is the sample code

 public void onReceive(Context context, Intent intent) {

                String action = intent.getAction();

                if( AppWidgetManager.ACTION_APPWIDGET_UPDATE.equals(action) ) {
                    int layoutID = R.layout.WidgetLayout;
                    int[] ids =
intent.getIntArrayExtra( AppWidgetManager.EXTRA_APPWIDGET_IDS );

                    for (int i=0; i<ids.length; i++)
                    {
                       int appWidgetId = ids[i];

                       RemoteViews views = new 
RemoteViews(context.getPackageName(),
layoutID );
                       updateMessageCount(count);
                       AppWidgetManager manager =
AppWidgetManager.getInstance( context );
                       manager.updateAppWidget(appWidgetId, views);
                    }

               }
        }

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to