我有办法从服务中获取图像资源吗?

问题描述

我想通过 Sevice 从应用资源中获取图像以设置某个属性

这可能吗?

解决方法

您可以使用与使用任何其他 Context 相同的方式来执行此操作。例如,您可以在 getResources() 上调用 Service,然后调用 call getDrawable() on the Resources object 以获取给定可绘制资源 ID 的 Drawable