无法使用毕加索库在Android中加载图像

sul*_*cid 1 url android image-loading imageview picasso

希望你做得很好,我正在开发一个应用程序,因为我想将一个图像从url加载到一个imageView中,我已经使用了Picasso lib,但它给了我未捕获的异常,我已经检查并调试了它是正确的网址即将到来和它的完美,我仍然面临这个问题,有人可以帮我解决这个问题吗?我的代码如下: 代码

Picasso.with(NewProfileActivity.this)
                        .load(mUser.userAvatarPath)
                        .into(iv_profile);
Run Code Online (Sandbox Code Playgroud)

这里,"iv_profile"是imageView,mUser.userAvatar Path是图片网址.

小智 6

试试这个

Picasso.with(this).load("http://api.androidhive.info/json/movies/1.jpg").placeholder(getResources().getDrawable(R.drawable.ic_launcher)).into(imageViewCenter);
Run Code Online (Sandbox Code Playgroud)