Picasso library does not load images from SD card on Android

柔情痞子 提交于 2019-12-03 13:38:36

Though it is too late , but I stuck into same problem, so I solved in the following way . Just using and appending "file://" in the starting of path. take a look at this:

 Picasso.with(context) //
                    .load("file://" +myFilePath) //
                    .error(R.mipmap.error)
                    .placeholder(R.mipmap.ic_launcher)
                    .fit()
                    .tag(MyActivity.this) //
                    .into(imageView, new ImageLoadedCallback(progressBar) {
                        @Override
                        public void onSuccess() {
                            progressBar.setVisibility(View.GONE);
                        }

                        @Override
                        public void onError() {
                            Log.d("Picasso Error", "Error");

                        }
                    });

This solves my problem . Just answering so that if some one fall in the same problem and came here for solution then he may get his problem solved through this.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!