Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

View instance from RemoteViews

How can I get View instance from RemoteViews ? There are RemoteViews.reapply and RemoteViews.apply API functions , but I don't know how to use them.

like image 999
holtaf Avatar asked Oct 10 '11 14:10

holtaf


2 Answers

If you are the one creating the RemoteViews to hand to something else -- as is the case with an AppWidgetProvider -- you cannot "get View instance from RemoteViews". The View hierarchy created from your RemoteViews is created in a different process than your own, and so you do not have direct access to it.

like image 66
CommonsWare Avatar answered Oct 25 '22 11:10

CommonsWare


You can use something like:

remoteViews.setTextViewText(R.id.widget_anything, "Anytext");
like image 28
Tobias Avatar answered Oct 25 '22 11:10

Tobias