草庐IT

AppWidgetTarget

全部标签

android - 使用 Glide for AppWidget 加载图像

我正在开发我的第一个应用小部件。除了一件事,一切都很好。我找不到,如何使用Glide在RemoteViewsFactroy的getViewAt()方法中将图像加载到ImageView中。我总是出错,因为我必须在MainThread遇到(AppWidgetTarget),但我无法从RemoteViewsFactory调用新的处理程序(Looper.getMainLooper())。 最佳答案 Glide通过提供AppWidgetTarget来支持这一点类。在onUpdate()中更新小部件时,您创建了一个新的AppWidgetTarg