Skip to content

Instantly share code, notes, and snippets.

@am5a03
Created June 23, 2020 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save am5a03/e9cb7d804e791bc13e6eef4922b90348 to your computer and use it in GitHub Desktop.
Save am5a03/e9cb7d804e791bc13e6eef4922b90348 to your computer and use it in GitHub Desktop.
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val view = inflater.inflate(R.layout.fragment_viewstub, container, false)
mViewStub = view.findViewById(R.id.fragmentViewStub) as ViewStub
mViewStub!!.layoutResource = getViewStubLayoutResource()
mSavedInstanceState = savedInstanceState
if (visible && !hasInflated) {
val 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