In my appWidgetProvider application, every time I need to update the appWidget application, I need to create a new RemoteViews object and assign it 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 actually I only need to change one thing, which is TextView Text.
Is it possible to somehow save RemoteViews for reuse it at the next update and just apply
view.setTextViewText(R.id.nick,wParameters.getNick()); appWidgetManager.updateAppWidget(appWidgetId, views);
again?
Or get a previously used RemoteViews object?
I want to achieve this because the process of setting new properties for the RemoteViews object is again very expensive in my appWidget application.
Suppose my widget is made from TextView and ImageView. An ImageView image is selected in the configureActivity widget (unique to each instance of appWidget), but image processing is expensive. TextView text needs to be changed in every update. I want to leave the ImageView image as it is, and change the text of the TextView only. Is it possible to update TextView without updating the image?
I will be happy for any help and ideas! Thanks, advanced, Gal.