Picasso 在片段的图像视图中不显示占位符、错误和 url 图像

Picasso doesnot show placeholder, error and url image in imageview of fragment

我正在尝试将图像下载到片段中的图像视图中,但它没有在图像视图中显示任何图像,甚至没有占位符和错误图像。我的代码在 fragment

中如下
 @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {



        View view = inflater.inflate(R.layout.fragment_one, container, false);
        ImageView imageView = (ImageView) view.findViewById(R.id.imageView);
        Context c = getActivity().getApplicationContext();
       Picasso.with(c)
                .load("http://inthecheesefactory.com/uploads/source/glidepicasso/cover.jpg").
        placeholder(R.drawable.aa).error(R.drawable.ab)
                .into(imageView);

        return inflater.inflate(R.layout.fragment_one, container, false);
    }

当我尝试在正常 activity 中使用相同的代码时,一切正常。问题只出现在片段 activity 中。我在 material 设计的滑动视图中使用图像视图。

你可以试试这个, 而不是这个

     return inflater.inflate(R.layout.fragment_one, container, false);

尝试

          return view;