-
-
Save andersu/203f69f2abdb29b6ad7f3447ac2ba31b to your computer and use it in GitHub Desktop.
Google View Binding example code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private var _binding: ResultProfileBinding? = null | |
// This property is only valid between onCreateView and | |
// onDestroyView. | |
private val binding get() = _binding!! | |
override fun onCreateView( | |
inflater: LayoutInflater, | |
container: ViewGroup?, | |
savedInstanceState: Bundle? | |
): View? { | |
_binding = ResultProfileBinding.inflate(inflater, container, false) | |
val view = binding.root | |
return view | |
} | |
override fun onDestroyView() { | |
super.onDestroyView() | |
_binding = null | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment