Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Ja'Nel Johnson](https://secure.gravatar.com/avatar/9fe0cde4ded4626a2b1b7ce29fedc605?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Ja'Nel Johnson
10,314 PointsWhat am I doing wrong?
Challenge 1/3: The class below is for a RecyclerView adapter. We need to add a view holder! Create a nested class called GameViewHolder. Make it public and have it extend RecyclerView.ViewHolder. Leave the rest blank for now.
I think I'm following the video, but I'm honestly confused.
Any suggestions?
Thank you.
public class GameAdapter extends RecyclerView.Adapter<GameAdapter.GameViewHolder> {
private Game[] mGames;
public GameAdapter(Game[] games) {
mGames = games;
}
@Override
public GameViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
return null;
}
@Override
public void onBindViewHolder(GameViewHolder holder, int position) {
// code omitted for brevity
}
@Override
public int getItemCount() {
return 0;
}
public class GameViewHolder extends RecyclerView.ViewHolder<GameView.GameViewHolder>{
}
4 Answers
![Seth Kroger](https://secure.gravatar.com/avatar/b5bdc43c1e576145fb404edba6fea5a6?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Seth Kroger
56,413 Points- you're missing a closing curly brace for the holder class. 2. You don't need the diamond operator for RecyclerView.ViewHolder, only RecyclerView.Adapter.
![Ja'Nel Johnson](https://secure.gravatar.com/avatar/9fe0cde4ded4626a2b1b7ce29fedc605?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Ja'Nel Johnson
10,314 PointsHi Seth,
I'm sorry. I'm not understanding.
Are you referring to the first line of code?
I'm working on the last line of code. Are your suggestions still applicable?
Thanks!
![Seth Kroger](https://secure.gravatar.com/avatar/b5bdc43c1e576145fb404edba6fea5a6?s=60&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Seth Kroger
56,413 PointsYes, I'm talking about the last line of code. The inner class should be declared as public class GameViewHolder extends RecyclerView.ViewHolder
![Ja'Nel Johnson](https://secure.gravatar.com/avatar/9fe0cde4ded4626a2b1b7ce29fedc605?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Ja'Nel Johnson
10,314 PointsThanks, Seth. I was able to finish the challenge.
![TERRENCE MAVHUNGA](https://uploads.teamtreehouse.com/production/profile-photos/7707812/micro_IMG_20161128_082510.jpg)
TERRENCE MAVHUNGA
6,053 Pointspublic class GameViewHolder extends RecyclerView.ViewHolder{ }