I have a fragment and I want to use a ViewStub for some data.
The problem I have is once I have inflated the ViewStub from the fragments Java class, how can I reference in the fragments java class components inside the ViewStub?
For example I currently use when the component is in the inflated view of the fragment;
TextView txtAwayPenStat = (TextView) myResInfoView.findViewById(R.id.txtAwayPenStat);
This will not work if the txtAwayPenStat is moved to the ViewStub.
I have tried a couple of approaches;
ViewStub viewStub = (ViewStub) getActivity().findViewById(R.id.info_detail_stub);
View inflatedView = viewStub.inflate();
Where getActivity() is I have also tried getView().