Skip to content

Instantly share code, notes, and snippets.

@bherbst
Last active July 21, 2017 14:35
Show Gist options
  • Save bherbst/022c3858ab379a6ea9fd324e34af5f8c to your computer and use it in GitHub Desktop.
Save bherbst/022c3858ab379a6ea9fd324e34af5f8c to your computer and use it in GitHub Desktop.
Kotlin Android Extensions nullability
import kotlinx.android.synthetic.main.fragment_main.*
class SampleFragment : Fragment() {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?): View? {
return inflater.inflate(R.layout.fragment_main, container, false)
}
override fun onDestroy() {
super.onDestroy()
Log.d("kotlinx", "onDestroy textView ID: " + textView.id)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment