Public class spinFragment extends AbstractSpinningFragment {
Context context;
private ExpandableAdapter expandableAdapter;
@BindView(R.id.recycler)
RecyclerView recyclerView;
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
final View fragmentView = inflater.inflate(R.layout.fragmentSpin, container, false);
this.sectionWebContentRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
recyclerView.setAdapter(this.expandableAdapter);
recyclerView.scrollToPosition(10);
return fragmentView;
}
I want to scroll to position 10 in my recyclerview. But it doesn't do anything.
I also tried: recyclerView.getLayoutManager().scrollToPosition(12); and smooth scrolling.
Anyone knows that the problem is?