Hi Subba,

I noticed the same thing happening with my widgets. The problem seems to be
that the OS doesn't re-load the various layouts after an update. By testing
I see that up to android 2.1 this problem exists. On 2.2 the widget is
completely reloaded when an update is installed.

What I noticed is that if you add new ids to your widget layouts, then the
widget is correctly reupdated also on versions <= 2.1. So, I currently use a
simple workaround that is to add a "fake" LinearLayout to my widget with a
new id, which is empty and has visibiliy="gone". Up to now my widgets seem
to have updated correctly.
Hope it works also for you ;)


Yuvi

On Fri, Jul 30, 2010 at 12:47 AM, Subba <[email protected]> wrote:

> Any help or suggestions?
>
> On Jul 28, 6:28 pm, Subba <[email protected]> wrote:
> > Application haswidgetwhich basically shows the number of new message
> > count in thewidget.Widgethas title and Count.When application gets
> > updated,widgettitle gets replaced with message count, and some times
> > it shows problem loadingwidget. seems like R value not updated after
> > app update. However user removes the application or reboot the
> phonewidgeticon 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]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
YuviDroid
Check out Launch-X <http://android.yuvalsharon.net/launchx.php> (a widget to
quickly access your favorite apps and contacts!)
http://android.yuvalsharon.net

-- 
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