I am trying to send some data from a Activity to Fragment.
I need to get the data in the onResume method of the fragment but I guess that`s not possible?
Arguments can only be received in onCreate()?
Activity:
public void someMethod() {
String someString = "test";
Bundle bundle = new Bundle();
bundle.putString("message", someString);
VFragment.getInstance().setArguments(bundle);
}
Fragment:
public class VFragment extends BaseFragment {
public static VFragment getInstance() {
return VFragment_.builder().build();
}
public VFragment() {
}
@Override
public void onResume() {
super.onResume();
String receive = getArguments().getString("message");
Log.v(TAG, receive); // NULL
}
}