@ Nullable public < P > P getListener ( Class < P > type ) { if ( mListener != null ) { return type . cast ( mListener ) ; } return null ; }
Gets the listener object that was passed into the Adapter through its constructor and cast it to a given type .