title: Cannot resolve method onItemClickListener in fragment
body: <p>I'm trying to implement an onClickListener from my adapter class to callback a method in my fragment. I followed an example but still getting an error for adapter.setOnItemClickListener in the fragment class and I can't see where the problem is.</p>
  
  <p>This is in my onCreateView method in my fragment class where i'm getting the error:</p>
  
  <pre><code>    SupportMapFragment mapFragment = (SupportMapFragment) getChildFragmentManager().findFragmentById(R.id.map);
      mapFragment.getMapAsync(this);
  
      ((BusAdapter) adapter).setOnItemClickListener(new BusAdapter.OnItemClickListener(){
          @Override
          public void onItemClick(View view, int position){
  
          }
      });
  
      return view;
  </code></pre>
  
  <p>This is the part of my adapter class that deals with the onClickListener: </p>
  
  <pre><code>    public BusAdapter() {
      }
  
      public interface OnItemClickListener{
          void onItemClick(View view, int pos);
      }
  
      public static class ViewHolder extends RecyclerView.ViewHolder {
          TextView timeTextView, destinationTextView, routeTextView, minsTextView;
  
          ViewHolder(View v) {
              super(v);
              this.timeTextView = v.findViewById(R.id.due);
              this.destinationTextView = v.findViewById(R.id.terminus);
              this.routeTextView = v.findViewById(R.id.route);
              this.minsTextView = v.findViewById(R.id.due_mins_text);
              v.setOnClickListener(new View.OnClickListener() {
                  @Override
                  public void onClick(View v) {
  
                      int position = ViewHolder.super.getAdapterPosition();
                      onItemClickListener.onItemClick(v, position);
                  }
              });
          }
      }
  </code></pre>