Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Android Android Fragments Introducing Fragments Making a List

ListViewHolder cannot resolve symbol

Hello, anytime I enter "ListViewHolder" it shows in red. When I hover my cursor over the word, it says "Cannot resolve symbol". Any help?

package com.example.moe.recipeapp;

import android.media.Image; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView;

public class ListAdapter extends RecyclerView.Adapter {

@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item, parent, false);
    return new ListViewHolder(view);

}

@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
    ((ListViewHolder) holder).bindView(position);
}

@Override
public int getItemCount() {
    return 0;
}

private class listViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {

    private TextView textView;
    private ImageView imageView;

    public listViewHolder(View itemView) {
        super(itemView);
        textView = (TextView) itemView.findViewById(R.id.itemTextView);
        imageView = (ImageView) itemView.findViewById(R.id.itemImageView);
        itemView.setOnClickListener(this);
    }

    public void bindView(int position) {
        textView.setText(Recipes.names[position]);
        imageView.setImageResource(Recipes.resourceIds[position]);
    }

    @Override
    public void onClick(View v) {

    }
}

}