获取appWidget的Imageview中的当前drawable

Get the current drawable in the Imageview of appWidget

我正在尝试获取我的应用程序小部件的 ImageView 的当前可绘制对象。但是appWidgetProvider中没有getDrawable()。如何获取Imageview的当前drawable?

例如。如果我在图像视图中有当前可绘制对象 A,我想将其更改为 B。但首先我想检查它是 A 还是 B 然后相应地更改。

How to get the current drawable of the Imageview?

这是不可能的,抱歉。

但是,由于您是定义 RemoteViews 使用的可绘制对象的人,您可以自己跟踪这一点,在数据库 SharedPreferences 或其他数据库中保留适当的标识符文件类型。