I want to transfer the user ID from the main Activity to a fragment.
So in the main activity, I do:
Fragment fragment = new Fragment(); final Bund
Just use:
String User = getArguments().getString("id_User", "Default Value");
The default value you supply will be returned if the key you request does not exist.