Picasso IllegalArgumentException Target must not be null

烂漫一生 提交于 2019-11-27 09:26:25

image is the target passed to into. It is what's null.

Ensure that your layout IDs are correct for all configurations and specify @+id/details_image.

make sure you inflating the correct xml That was my problem since I copied an already existing adapter and forgot to change that

@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    View v = LayoutInflater.from(context)
            .inflate(R.layout.list_item_subcategories, parent, false);

Where the layout I should have put was list_item_categories

Maybe painting.getImageId() is empty or null?

Or image or getActivity()? :)

I know this is a little bit old, but one thing that I just spent a bunch of time on is forgetting to run "setContentView" to the layout that the image was on.

The ImageView is going to be null until the main layout that it lives on is inflated ;)

Raj Godara

Check the ID of your imageview object is correct -

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