1

I am writing an AppWidget which has a view(Textview for example) displaying information what the user chooses , I want my UI-event handler to update ONLY the textview each time UI-Event is triggered , the question is how do I update ONLY the Textview via Remoteviews , is the AppWidgetManager's partiallyUpdateAppWidget method the solution, if true , please show me its usage , thanks in advance

user718146
  • 400
  • 1
  • 4
  • 16

1 Answers1

0

if you write it to api 11 and above use:

 // Get the layout for the App Widget  
RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget);
views.setTextViewText(id,text);
appWidgetManager.updateAppWidget(appWidgetId, views);

as shown in this question How to partially update views in an app widget without rebuilding all the RemoteViews

otherwise rebuild the entire removeviews (basiclly call remoteViews again)

Community
  • 1
  • 1
Gabriel H
  • 1,558
  • 2
  • 14
  • 35