Java 不加载毕加索图像
我在使用毕加索图书馆时遇到了一个问题。当我使用这个库时(Java 不加载毕加索图像,java,android,imageview,picasso,Java,Android,Imageview,Picasso,我在使用毕加索图书馆时遇到了一个问题。当我使用这个库时(implementation'com.squareup.picasso:picasso:2.71828'),我的图像不会显示在图像视图中。在运行我的应用程序时,甚至默认的化身也会被删除 Mmy代码是 try { //if image recieve then set Picasso.get().load(image).into(avaterIv); }catch (Exception e){ //if there is an
implementation'com.squareup.picasso:picasso:2.71828'
),我的图像不会显示在图像视图中。在运行我的应用程序时,甚至默认的化身也会被删除
Mmy代码是
try {
//if image recieve then set
Picasso.get().load(image).into(avaterIv);
}catch (Exception e){
//if there is any exception while loading image the set default
Picasso.get().load(R.drawable.ic_add_image).into(avaterIv);
}
你的电话必须是
Picasso
.with(imageView.getContext())
.load(image_url)
.placeholder(R.mipmap.ic_launcher_round)
.into(imageView);
您可以尝试添加
回调
,首先确定您的问题,以便能够解决它
Picasso.get().load(image).into(avaterIv, new Callback() {
@Override
public void onSuccess() {
}
@Override
public void onError(Exception e) {
Log.d("Error",e.printStackTrace());
}
});
请提供布局xml,并澄清您将此代码称为什么函数?\\n如果我的答案有效。。请把它标为接受答案。。提前谢谢