I want to pass user id from main operation to fragment.
So basically I do:
Fragment fragment = new Fragment(); final Bundle bundle = new Bundle(); bundle.putString("id_User", id); Log.i("BUNDLE", bundle.toString()); fragment.setArguments(bundle);
And in the magazine I see
BUNDLE : Bundle[{id_User=1}]
In the snippet, I test it in onCreate
Bundle arguments = getArguments(); if (arguments != null) { Log.i("BUNDLE != null","NO NULL"); } else { Log.i("BUNDLE == null","NULL"); }
And I have
BUNDLE == null: NULL
So, the transfer was successful, but how can I get the data in the fragment, please?
user2903095
source share