I have an activity which does a fragment transaction
DetailFragment newFragment = new DetailFragment();
transaction.replace(R.id.mylist, newFragment);
transa
Your Fragment hasn't attached to the Activity yet, which also means your layout hasn't been inflated yet (See the Fragment lifecycle). The best solution here would be to add your String value as an argument to the Fragment via the Fragment.setArguments(Bundle) method. This can be retrieved in the receiving Fragment via the Fragment.getArguments() method.