Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/333.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 不加载毕加索图像_Java_Android_Imageview_Picasso - Fatal编程技术网

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如果我的答案有效。。请把它标为接受答案。。提前谢谢