" RES"在BitmapDrawable(资源res,Bitmap位图)中,我们可以使用Resources.getSystem()吗?或者只能使用context.getResource()?

时间:2016-08-22 07:58:41

标签: android bitmap android-resources

在android的源代码中

/**
 * Return a global shared Resources object that provides access to only
 * system resources (no application resources), and is not configured for
 * the current screen (can not use dimension units, does not change based
 * on orientation, etc).
 */
public static Resources getSystem() {
    synchronized (sSync) {
        Resources ret = mSystem;
        if (ret == null) {
            ret = new Resources();
            mSystem = ret;
        }

        return ret;
    }
}

从代码中我们可以得到getSystem()返回的资源没有为当前屏幕配置,所以在BitmapDrawable(Resource res,Bitmap bitmap)中,是不是我们只能使用context.getResource()?

0 个答案:

没有答案
相关问题