Avoid passing null as the view root (need to resolve layout parameters on the inflated layout’s root element)

Instead of doing

convertView = infalInflater.inflate(R.layout.list_item, null);

do

convertView = infalInflater.inflate(R.layout.list_item, parent, false);

It will inflate it with the given parent, but won’t attach it to the parent.

Leave a Comment