我正在尝试在每一行中实际实现一个具有不同布局的列表视图。我坚持这一点。我收到与该部分rows.add(new ImageRow(LayoutInflater.from(FeedAdapter.this), feed));
相同的错误。descriptionRow
final List<Row> rows;
FeedAdapter(List<Feed> feeds) {
rows = new ArrayList<Row>();//member variable
for (Feed feed : feeds) {
//if it has an image, use an ImageRow
if (feed.getImageID() != null) {
rows.add(new ImageRow(LayoutInflater.from(FeedAdapter.this), feed));
} else {//otherwise use a DescriptionRow
rows.add(new DescriptionRow(LayoutInflater.from(FeedAdapter.this), feed));
}
}
}