title: Android OnClickListener for RecyclerView's Child's Child
body: <p>What I want to do is set an onClickListener for an ImageView that is in an item in a recyclerview. I only want a click on that ImageView to do CODE A and click anywhere else to run CODE B. How can I do that? I am using:</p>
  
  <pre><code>    public class RecyclerAdapter extends RecyclerView.Adapter&lt;RecyclerAdapter.RecyclerViewHolder&gt; {
  
      LayoutInflater inflater;
      Context context;
  
      ClickListener clickListener;
  
      List&lt;PostContent&gt; posts = Collections.emptyList();
  
      public RecyclerAdapter(Context context) {
          this.context = context;
          inflater = LayoutInflater.from(context);
      }
  
      public void setPosts(List&lt;PostContent&gt; posts) {
          this.posts = posts;
      }
  
      @Override
      public RecyclerViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
          View view = inflater.inflate(R.layout.post_row, viewGroup, false);
          RecyclerViewHolder viewHolder = new RecyclerViewHolder(view);
          return viewHolder;
      }
  
      @Override
      public void onBindViewHolder(RecyclerViewHolder viewHolder, int i) {
          viewHolder.name.setText(posts.get(i).name);
          viewHolder.username.setText("@" + posts.get(i).username);
          viewHolder.time_post.setText(posts.get(i).time_post);
          viewHolder.content.setText(posts.get(i).content);
      }
  
      @Override
      public int getItemCount() {
          return posts.size();
      }
  
      public void setClickListener(ClickListener clickListener) {
          this.clickListener = clickListener;
      }
  
      public interface ClickListener {
          public void ItemClicked(View view, int pos);
      }
  
      public class RecyclerViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
  
          TextView name;
          TextView username;
          TextView time_post;
          TextView content;
          ImageView profile;
  
          public RecyclerViewHolder(View itemView) {
              super(itemView);
              name = (TextView) itemView.findViewById(R.id.name);
              username = (TextView) itemView.findViewById(R.id.username);
              time_post = (TextView) itemView.findViewById(R.id.time);
              content = (TextView) itemView.findViewById(R.id.content);
              profile = (ImageView) itemView.findViewById(R.id.profile);
  
              itemView.setOnClickListener(this);
          }
  
          @Override
          public void onClick(View v) {
              if (clickListener != null) {
                  clickListener.ItemClicked(v, getPosition());
              }
          }
  
      }
  
  }
  </code></pre>
  
  <p>for my adapter and view holder.</p>