In my appWidgetProvider, every time I need to update an appWidget I have to create new RemoteViews object and assign it's properties:
RemoteViews views = new RemoteViews(context.getPackageName(),layout);
views.setOnClickPendingIntent(R.id.widgetLayout, pendingIntent);
view.setFloat(R.id.nick, "setTextSize", wParameters.getFontSize());
view.setTextViewText(R.id.nick,wParameters.getNick());
.........etc
appWidgetManager.updateAppWidget(appWidgetId, views);
But in fact, I only need to change one thing which is the TextView Text.
Can I somehow store the RemoteViews for reusing it on the next update, and just applying
view.setTextViewText(R.id.nick,wParameters.getNick());
appWidgetManager.updateAppWidget(appWidgetId, views);
again?
Or get the previously used RemoteViews object somehow?
I want to achieve this because the process of setting the new RemoteViews object properties again is very expensive in my appWidget.
Let's assume my widget is made of a TextView and a ImageView. The ImageView's image is chosen in the widget's configureActivity (unique for every instance of the appWidget), but the image procssing is expensive. the TextView text is needed to be changed in every update. I want to leave the ImageView image as it is, and only change the text of the TextView. is it posible to update the TextView without updating the imageView?
Will be glad for any help and ideas! Thanks advanced, Gal.