I want to transfer data between two fragments without using the activity and fragment activity.
I do not want to transfer data between fragments using the following actions: Communicating with other fragments
Below is my scenario:
I have one parent fragment and inside it there are two child fragments. Now I need to transfer data between these two fragments. How to do it?
I reviewed this: Event Bus , but not getting a working example for fragments.
Is there any other alternative for transferring data between fragments?
Any help would be appreciated.
Edited as InnocentKiller answer:
In FragmentOne, I implemented:
FragmentTwo = new FragmentTwo();
Bundle bundle = new Bundle();
bundle.putString("Hello", "My name is Siddharth");
fragment.setArguments(bundle);
In FragmentTwo, I implemented:
Bundle bundle = this.getArguments();
String myInt = bundle.getString("Hello","Test");
mStartTripButton.setText(myInt);