ImageLoader.java 文件源码

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

项目:GitHub 作者:
/**
     * From Assets
     *
     * @param imageUri
     * @param imageView
     * @throws java.io.IOException
     */
    protected void displayImageFromAssets(String imageUri, ImageView imageView) throws IOException {
        String filePath = Scheme.ASSETS.crop(imageUri);
        Bitmap bitmap;
        try {
            bitmap = BitmapFactory.decodeStream(context.getAssets().open(filePath));
        } catch (IOException e) {
            e.printStackTrace();
            return;
        }
        if (imageView != null) {
//            imageView.setImageBitmap(bitmap);
            Glide.with(context).load(inputStreamToByte(context.getAssets().open(filePath))).into(imageView);
//            Log.i("杭鹏伟", " " + imageUri + " " + filePath);
        }
    }
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号