ImageFragment.java 文件源码

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

项目:SteamGifts 作者:
@Override
protected byte[] doInBackground(Void... params) {
    try {
        // Grab an input stream to the image
        OkHttpDownloader downloader = new OkHttpDownloader(getContext());
        Downloader.Response response = downloader.load(Uri.parse(url), 0);

        // Read the image into a byte array
        return Okio.buffer(Okio.source(response.getInputStream())).readByteArray();
    } catch (Exception e) {
        Log.d(ImageFragment.class.getSimpleName(), "Error fetching image", e);
        return null;
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号