private OnItemClickListener createItemClickListener ( @ NonNull final OnItemClickListener encapsulatedListener ) { return new OnItemClickListener ( ) { @ Override public void onItemClick ( final AdapterView < ? > parent , final View view , final int position , final long id ) { encapsulatedListener . onItemClick ( parent , view , getItemPosition ( position ) , id ) ; } } ; }
Creates and returns a listener which encapsulates another listener in order to be able to adapt the position of the item which has been clicked .