0

I have a MainActivity, Contains TabLayout having two fragments FA, FB

The First Fragment FA having another Tablayout contains 2 fragments FAA, FAB

I have a button inside FAA, i want when i click on it, it send me to FB which already inside the parent TabLayout

I tried many solutions but it didn't help, any suggestions?

    @OnClick(R.id.frag_timeline_fab_faa)
public void goToFBFromFAA(View view) {

    // Code shoud be here
}
Marzouk
  • 2,650
  • 3
  • 25
  • 56

1 Answers1

2

The way to do this is through interfaces.Here is a similar question I found

In fragment FAA:

public interface OnFragmentInteractionListener {
    void onFragmentInteraction(Param param);
}

Then in your parent fragment you need to implement that interface:

public class FA extends Fragment implements 
        FAA.OnFragmentInteractionListener {
    @Override
    public void onFragmentInteraction(Param param) {
    //Your code here
    }
}
Community
  • 1
  • 1
Charles
  • 61
  • 5