在android中访问drawable文件夹外的图像

在android中访问drawable文件夹外的图像,android,image,Android,Image,我一直在使用drawable文件夹中的图像在我的Android应用程序中显示图像。有没有办法访问drawable文件夹之外的图像?或通过url在另一个中的图像?该类有不同的方法,允许您解码来自流或文件的资源,您应该将其签出。只需使用PackageManager: getDrawable (String packageName, int resid, ApplicationInfo appInfo)

我一直在使用drawable文件夹中的图像在我的Android应用程序中显示图像。有没有办法访问drawable文件夹之外的图像?或通过url在另一个中的图像?

该类有不同的方法,允许您解码来自流或文件的资源,您应该将其签出。

只需使用PackageManager:

  getDrawable (String packageName, int resid, ApplicationInfo appInfo)