小编ini*_*ise的帖子

Picasso 第一次没有调用 onBitmapLoaded

毕加索不是onBitmapLoaded第一次打电话,如果你知道,请告诉我

        txtView = (TextView) centerRelative.getChildAt(i);
                Picasso.with(getBaseContext()).load(file[i-4]).into(new Target() {
                    @Override
                    public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {
                        txtView.setBackground(new BitmapDrawable(getResources(),bitmap));
//                      Not executing for the first time

                    }

                    @Override
                    public void onBitmapFailed(Drawable errorDrawable) {

                    }

                    @Override
                    public void onPrepareLoad(Drawable placeHolderDrawable) {
//                      executing for the first time
                    }
                });

Target target = new Target() {
                    @Override
                    public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {
                        txtView.setBackground(new BitmapDrawable(getResources(),bitmap));
                        logd("onBitmapLoaded");
                    }

                    @Override
                    public void onBitmapFailed(Drawable errorDrawable) {

                    }

                    @Override
                    public void onPrepareLoad(Drawable placeHolderDrawable) { …
Run Code Online (Sandbox Code Playgroud)

android picasso

1
推荐指数
1
解决办法
1065
查看次数

标签 统计

android ×1

picasso ×1