title: RelativeLayout cannot be cast to ImageView?
body: <p>I'm currently building a twitter client and in this java class i'm having 3 errors that i'm not sure how to tackle. I tried setting the ImageView type beforehand but it did not work. for example; i had <code>ivProfileImage = (ImageView)</code> but was not successful. I tried googling multiple solutions but none of them work. Not sure if the problem is in the Java Class or is it something else? </p>
  
  <p>Error im getting: </p>
  
  <pre><code>java.lang.ClassCastException: android.widget.RelativeLayout cannot be cast to android.widget.ImageView
  </code></pre>
  
  <p>my code:</p>
  
  <pre><code>package com.codepath.apps.restclienttemplate;
  import android.support.annotation.NonNull;
  import android.support.v7.widget.RecyclerView;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.*;
  import android.content.*;
  import java.util.*;
  import com.bumptech.glide.*;
  import com.codepath.apps.restclienttemplate.models.Tweet;
  
  
  public class TweetsAdapter extends RecyclerView.Adapter&lt;TweetsAdapter.ViewHolder&gt; {
      private Context context;
      private List&lt;Tweet&gt; tweets;
  
      public TweetsAdapter(Context context, List&lt;Tweet&gt; tweets) {
          this.context = context;
          this.tweets = tweets;
      }
  
      public class ViewHolder extends RecyclerView.ViewHolder{
  
          public ImageView ivProfileImage;
          public TextView tvScreenName;
          public TextView tvBody;
  
          public ViewHolder(View itemView) {
              super(itemView);
              ivProfileImage = itemView.findViewById(R.id.ivProfileimage);
              tvScreenName = itemView.findViewById(R.id.tvScreenName);
              tvBody = itemView.findViewById(R.id.tvBody);
          }
      }
  
      @NonNull
      @Override
      public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int i) {
          View view = LayoutInflater.from(context).inflate(R.layout.item_tweet, parent, false);
          return new ViewHolder(view);
      }
  
      @Override
      public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
          Tweet tweet = tweets.get(position);
          holder.tvBody.setText(tweet.body);
          holder.tvScreenName.setText(tweet.user.screenName);
          Glide.with(context).load(tweet.user.profileImageUrl).into(holder.ivProfileImage);
      }
  
  
      @Override
      public int getItemCount() {
          return tweets.size();
      }
  }
  </code></pre>