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
Asked
Active
Viewed 949 times
1
-
nice one ,if u find something usefull add it – Shakeeb Ayaz Jul 18 '13 at 08:03
1 Answers
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)