I have an activity which does a fragment transaction
DetailFragment newFragment = new DetailFragment();
transaction.replace(R.id.mylist, newFragment);
transa
So i am also using the same fragment transaction manager and the only problem i can see with your code is that you define the TextView tv inside your onCreateView method of your newFragment class and then instantiate it as like this :
public class AboutFragment extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.newFragment, container, false);
TextView tv = (TextView) v.findViewById(R.id.textview);
return v;
}
public void setMyString(String s) {
tv.setText(s);
}
}
I know it does'nt make really much sense but that is how i am running my code and it works fine :)