简体   繁体   中英

Update AppWidget from an Activity

I'm trying to update my AppWidget from my activity. Similar to this question:

Programmatically update widget from activity/service/receiver

I'm using AppWidgetManager to get the ids and send an update broadcast but it doesn't work for me.

I suspect that it's because my AppWidgetProvider is in a library project and thus under a different package than my main app.

Any ideas on how to make it work? I tried all kind of contexts (this, getApplication() , etc.) , nothing worked. (I don't get the ids of the widgets).

Thanks.

我必须在组件名称中使用应用程序的包名称,并在类的库中使用完整的类名。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM