I have a fragment (A) with a TextView with the value "XXXX" set using the setText () method. I replace fragment (A) with fragment (B) and then replace B again with A.
When I do this, the value XXXX will disappear in the (A) TextView snippet. I tried calling the TextView.setText method on onStart, as well as the onResume methods - the same result. When I debug the code, I can literally see that the setText method and value XXXX are used. I printed it on LogCat and it is there too, but I do not see any values on the screen.
I tried google search and I could not get an answer. I would appreciate any pointers.
code
public void onResume() { super.onResume(); String dData = readFileFromSDCard(); String dArray[] = dData.split(";"); txtName = (TextView) getActivity().findViewById(R.id.txtName); txtName.setText("first name") }
source share