Hi I'm trying to pass a string variable from an activity into a fragment but it's always null.
Firstly I set the variable value, then create the bundle in the Activity:
String results = setResultCaption(bothEarsBad, leftEarBad, rightEarBad).toString();
Then
Bundle bundle = new Bundle();
bundle.putString("resultsString", results);
RightEarResults rightEarResults = new RightEarResults();
rightEarResults.setArguments(bundle);
I then call the bundle
from the fragment onCreateView
method as follows:
String bundle = getArguments().getString("resultsString");
And then set the variable in the TextView
txt = (TextView) rootView.findViewById(R.id.results_text);
txt.setText(bundle);
Can anyone help me understand why it's always null.