MediaStoreUtils.java 文件源码

java
阅读 32 收藏 0 点赞 0 评论 0

项目:boohee_v5.6 作者:
public static Bitmap getBitmapFromUri(Context context, Uri uri, Options options) {
    Bitmap bitmap = null;
    InputStream is = null;
    try {
        is = context.getContentResolver().openInputStream(uri);
        bitmap = BitmapFactory.decodeStream(is, null, options);
        if (is != null) {
            try {
                is.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    } catch (FileNotFoundException e2) {
        e2.printStackTrace();
        if (is != null) {
            try {
                is.close();
            } catch (IOException e3) {
                e3.printStackTrace();
            }
        }
    } catch (Throwable th) {
        if (is != null) {
            try {
                is.close();
            } catch (IOException e32) {
                e32.printStackTrace();
            }
        }
    }
    return bitmap;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号