开发者

View instance from RemoteViews

开发者 https://www.devze.com 2023-04-11 19:29 出处:网络
How can I get开发者_如何学JAVA View instance from RemoteViews ? There are RemoteViews.reapply and RemoteViews.apply API functions , but I don\'t know how to use them.If you are the one creating the Re

How can I get开发者_如何学JAVA View instance from RemoteViews ? There are RemoteViews.reapply and RemoteViews.apply API functions , but I don't know how to use them.


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.


You can use something like:

remoteViews.setTextViewText(R.id.widget_anything, "Anytext");
0

精彩评论

暂无评论...
验证码 换一张
取 消