簡體   English   中英

SkImageDecoder :: Factory使用Glide返回null

[英]SkImageDecoder::Factory returned null with Glide

我試圖用滑動加載圖像,但我總是得到SkImageDecoder::Factory returned null錯誤,這里有什么不對? 在屏幕上看起來我有小白色方塊而不是圖片。

編輯

 private GiphyGifData getGif(String jsonData) throws JSONException {
        Log.e("josn",jsonData);
        JSONObject giphy = new JSONObject(jsonData);
        JSONArray dataList = giphy.getJSONArray("data");

        list.clear();
        for (int i=0;i<dataList.length();i++) {
            Log.e("url",dataList.getJSONObject(i).getString("url"));
            list.add(dataList.getJSONObject(i).getString("url"));
        }
        GiphyGifData gif = new GiphyGifData();
        gif.setUrlList(list);

        Log.i(TAG, "Gif JSON Data - GIF URL: " + gif);

        return gif;
    }


public class MyRVAdapter extends RecyclerView.Adapter<MyRVAdapter.MyViewHolder> {

    private Context context;
    ArrayList<String> urlList;


    @Override
    public MyRVAdapter.MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.listview_item, parent, false);

        return new MyViewHolder(v);
    }

    @Override
    public void onAttachedToRecyclerView(RecyclerView recyclerView) {
        super.onAttachedToRecyclerView(recyclerView);
    }

    public MyRVAdapter(ArrayList<String> actionList, Context context) {
        this.urlList = actionList;
        this.context = context;
    }

    @Override
    public void onBindViewHolder(MyRVAdapter.MyViewHolder holder, int position) {
        Log.e("here","i am here");
        Log.e("lsit",urlList.size()+"");
        Log.e("lsit",urlList.get(position));

        Glide.with(context).load(urlList.get(position))
                .thumbnail(0.5f)
                .error(R.drawable.cutecat001)
                .crossFade()
                .diskCacheStrategy(DiskCacheStrategy.ALL)
                .into(holder.image);
    }

    @Override
    public int getItemCount() {
        return urlList.size();
    }

    public class MyViewHolder extends RecyclerView.ViewHolder{

        RecyclerView rv;
        ImageView image;

        public MyViewHolder(View itemView) {
            super(itemView);
            image = (ImageView) itemView.findViewById(R.id.imageView);
        }
    }
}

日志:

11-08 07:32:35.945 10349-10410/com.superlifesize.gifdrawabledemo E/url: http://giphy.com/gifs/filmeditor-movie-set-it-off-3otPoCGZZDzXlxxtkc
11-08 07:32:35.945 10349-10410/com.superlifesize.gifdrawabledemo E/url: http://giphy.com/gifs/mrw-oc-jam-2jg9inCU6MMCI
11-08 07:32:35.945 10349-10410/com.superlifesize.gifdrawabledemo E/url: http://giphy.com/gifs/wave-slime-xTiTngMMCIt7FramOc
11-08 07:32:35.945 10349-10410/com.superlifesize.gifdrawabledemo E/url: http://giphy.com/gifs/filmeditor-movie-set-it-off-3o6wr9O7eCSG3T1y80
11-08 07:32:35.945 10349-10410/com.superlifesize.gifdrawabledemo E/url: http://giphy.com/gifs/set-it-off-jada-pinkett-smith-1996-zmgvTFNK5Lp7i
11-08 07:32:35.945 10349-10410/com.superlifesize.gifdrawabledemo E/url: http://giphy.com/gifs/justin-buh-bye-l0MYzLLxlJDfYtzy0
11-08 07:32:35.945 10349-10410/com.superlifesize.gifdrawabledemo E/url: http://giphy.com/gifs/donald-glover-atlanta-fx-earn-marks-l0HlKe3FvhK6WfMMU
11-08 07:32:35.945 10349-10410/com.superlifesize.gifdrawabledemo E/url: http://giphy.com/gifs/cbs-codeblack-l0HlV8Sa0VGALZ0He
11-08 07:32:35.945 10349-10410/com.superlifesize.gifdrawabledemo E/url: http://giphy.com/gifs/ride-MjiO4GHq4LpGE
11-08 07:32:35.945 10349-10410/com.superlifesize.gifdrawabledemo E/url: http://giphy.com/gifs/filmeditor-movie-set-it-off-3otPoJBvEJ57NvzAuQ
11-08 07:32:35.945 10349-10410/com.superlifesize.gifdrawabledemo E/url: http://giphy.com/gifs/filmeditor-movie-set-it-off-l2YWE75v0lXwsbsc0
11-08 07:32:35.945 10349-10410/com.superlifesize.gifdrawabledemo E/url: http://giphy.com/gifs/asking-for-a-friend-l0MYrjz8AXEZQJ60M
11-08 07:32:35.945 10349-10410/com.superlifesize.gifdrawabledemo E/url: http://giphy.com/gifs/editingandlayout-smile-beach-drink-5xtDarqlsEW6F7F14Fq
11-08 07:32:35.945 10349-10410/com.superlifesize.gifdrawabledemo E/url: http://giphy.com/gifs/justin-cartoon-subway-xT9KVDBYat4ypqtX8c
11-08 07:32:35.945 10349-10410/com.superlifesize.gifdrawabledemo E/url: http://giphy.com/gifs/7QJnyNiP2hMt2
11-08 07:32:35.945 10349-10410/com.superlifesize.gifdrawabledemo E/url: http://giphy.com/gifs/art-cry-emoji-SM0uVNxZYNTwc
11-08 07:32:35.945 10349-10410/com.superlifesize.gifdrawabledemo E/url: http://giphy.com/gifs/spidercat-rXqhNCUMwqfLO
11-08 07:32:35.945 10349-10410/com.superlifesize.gifdrawabledemo E/url: http://giphy.com/gifs/funny-cute-dog-bhSi84uFsp66s
11-08 07:32:35.945 10349-10410/com.superlifesize.gifdrawabledemo E/url: http://giphy.com/gifs/vine-DXnIMtlOlHgpW
11-08 07:32:35.945 10349-10410/com.superlifesize.gifdrawabledemo E/url: http://giphy.com/gifs/sweet-7F5RBG1GX8dP2
11-08 07:32:35.945 10349-10410/com.superlifesize.gifdrawabledemo E/url: http://giphy.com/gifs/aliciakeys-nbc-the-voice-3oz8xWxaJSqJoOqO6Q
11-08 07:32:35.945 10349-10410/com.superlifesize.gifdrawabledemo E/url: http://giphy.com/gifs/tvland-younger-youngertv-l2QZO2X3cTGUv37oY
11-08 07:32:35.945 10349-10410/com.superlifesize.gifdrawabledemo E/url: http://giphy.com/gifs/screamqueens-fox-scream-queens-tv-3o6ZsS8GFJKJeJoRQ4
11-08 07:32:35.945 10349-10410/com.superlifesize.gifdrawabledemo E/url: http://giphy.com/gifs/oPyzztuHVnRvO
11-08 07:32:35.945 10349-10410/com.superlifesize.gifdrawabledemo E/url: http://giphy.com/gifs/snl-saturday-night-live-special-l0HlGGXIZNra3i4OQ
11-08 07:32:35.945 10349-10410/com.superlifesize.gifdrawabledemo I/MainActivity: Gif JSON Data - GIF URL: com.superlifesize.giftest.GiphyGifData@e841697
11-08 07:32:35.945 10349-10410/com.superlifesize.gifdrawabledemo V/MainActivity: Giphy Gif Data from Response: com.superlifesize.giftest.GiphyGifData@e841697
11-08 07:32:35.997 10349-10349/com.superlifesize.gifdrawabledemo E/here: i am here
11-08 07:32:35.997 10349-10349/com.superlifesize.gifdrawabledemo E/lsit: 25
11-08 07:32:35.997 10349-10349/com.superlifesize.gifdrawabledemo E/lsit: http://giphy.com/gifs/filmeditor-movie-set-it-off-3otPoCGZZDzXlxxtkc
11-08 07:32:36.009 10349-10349/com.superlifesize.gifdrawabledemo E/here: i am here
11-08 07:32:36.009 10349-10349/com.superlifesize.gifdrawabledemo E/lsit: 25
11-08 07:32:36.009 10349-10349/com.superlifesize.gifdrawabledemo E/lsit: http://giphy.com/gifs/mrw-oc-jam-2jg9inCU6MMCI
11-08 07:32:36.454 10349-10415/com.superlifesize.gifdrawabledemo D/skia: --- SkImageDecoder::Factory returned null
11-08 07:32:36.454 10349-10416/com.superlifesize.gifdrawabledemo D/skia: --- SkImageDecoder::Factory returned null

我認為你使用無效的url而不是滑行你可以使用Picasso來高效加載圖像http://square.github.io/picasso/它對我來說像岩石一樣工作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM