I have an activity and I create a fragment when this activity runs. How do I get the data from the fragment to the activity that creates the fragment?
The part where I create an intent in my activity:
@Override
protected void onNewIntent(Intent intent) {
    super.onNewIntent(intent);
    setIntent(intent);
    RoutePlansFragment routePlansFragment = RoutePlansFragment.newInstance();
    FragmentTransactionUtil.addFragment(getSupportFragmentManager(), getFragmentContainerId(), routePlansFragment, routePlansFragment.getFragmentTag());
}
This is my fragment:
public static RoutePlansFragment newInstance() {
    RoutePlansFragment routePlansFragment = new RoutePlansFragment();
    return routePlansFragment;
}
How can I send data from this fragment into activity?