Skip to content

Instantly share code, notes, and snippets.

@raymondctc
Last active December 18, 2017 03:25
Show Gist options
  • Select an option

  • Save raymondctc/823fad261dde52c5bb025cebf8f2c4ba to your computer and use it in GitHub Desktop.

Select an option

Save raymondctc/823fad261dde52c5bb025cebf8f2c4ba to your computer and use it in GitHub Desktop.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_viewstub, container, false);
mViewStub = (ViewStub) view.findViewById(R.id.fragmentViewStub);
mViewStub.setLayoutResource(getViewStubLayoutResource());
mSavedInstanceState = savedInstanceState;
if (getUserVisibleHint() && !mHasInflated) {
View inflatedView = mViewStub.inflate();
onCreateViewAfterViewStubInflated(inflatedView, mSavedInstanceState);
afterViewStubInflated(view);
}
return view;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment