public void init(final Context context, Adapter mAdapter) {
        if(context instanceof onFlingListener) {
            mFlingListener = (onFlingListener) context;
        }else{
            throw new RuntimeException("Activity does not implement SwipeFlingAdapterView.onFlingListener");
        }
        if(context instanceof OnItemClickListener){
            mOnItemClickListener = (OnItemClickListener) context;
        }
        setAdapter(mAdapter);
    }
A shortcut method to set both the listeners and the adapter.

@param context The activity context which extends onFlingListener, OnItemClickListener or both
@param mAdapter The adapter you have to set.
library/src/main/java/com/lorentzos/flingswipe/SwipeFlingAdapterView.java