In the application resykler is in the fragment. You need to get the index of the item you clicked to display certain information.
Wrote a callback, it passes from the adapter to the index fragment. But I ran into a stupid task, to which I don’t really know how to approach.
The fact is that this fragment is in tabs, and it is added as follows:
String tabs[] = { "FORM", "PREVIEW" }; public SuggestTabsPagerFragmentAdapter(FragmentManager fm) { super(fm); } @Override public CharSequence getPageTitle(int position) { return tabs[position]; } @Override public Fragment getItem(int position) { switch (position) { case 0: return SuggestTermFragment.getInstance(); case 1: return SuggestTermFragment.getInstance(); } return null; } @Override public int getCount() { return tabs.length; } } In other words, FragmentManager not used, and I don’t really imagine how to get the necessary index for activation from a fragment.
Tried to make a method (not static), which gets intu. But through getActivity() this method was not visible (obviously led to MainActivity - did not help).
Principle, you can do static, but it is too. Maybe there is some more humane way out?
UPD:

public int setSheetIndex(int sheetIndex){ return sheetIndex; }public int setSheetIndex(int sheetIndex){ return sheetIndex; }Activation Method - Silento