You can achieve this in multiple ways, but I'll give you one supposing that both Fragments are displayed at the same time.
In your ChildTwo
use getParentFragment
to get MainFragment
.
MainFragment parent = (MainFragment) getParentFragment();
String edit_text_value = parent.getChildOneText();
In your MainFragment
you need a reference object to your ChildOne
fragment.
public String getChildOneText()
{
return mFirstFragment.getEditTextValue();
}
Finally in your ChildOne
fragment create a method to return your EditText
.
public String getEditTextValue()
{
return my_edit.getText().toString();
}
Hope it helps!