// MyFragment.kt

class MyFragment : Fragment(R.layout.fragment_my) {
  private var _binding: MyFragmentBinding? = null
  private val binding get() = _binding!!

  override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
    super.onViewCreated(view, savedInstanceState)
    _binding = MyFragmentBinding.bind(view)
    binding.someview.text = "bla bla"

  override fun onDestroyView() {
    _binding = null
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter