@Override public void setUserVisibleHint(boolean isVisibleToUser) { super.setUserVisibleHint(isVisibleToUser); if (isVisibleToUser && mContext != null && mRecyclerView != null) { getActivity() .findViewById(R.id.toolbar) .setOnClickListener(CustomOnClickListener.doubleClickToListTop(mContext, mRecyclerView)); } }
@Override protected void setupRecyclerView() { super.setupRecyclerView(); if (!isSetToolbar) { isSetToolbar = !isSetToolbar; getActivity() .findViewById(R.id.toolbar) .setOnClickListener(CustomOnClickListener.doubleClickToListTop(mContext, mRecyclerView)); } }