Last active
July 21, 2017 14:21
-
-
Save bherbst/f114b37cfdf3680e34612c72d6555f8d to your computer and use it in GitHub Desktop.
Android View Nullability
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
class SampleFragment : Fragment() { | |
private var textView: TextView? = null | |
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, | |
savedInstanceState: Bundle?): View? { | |
return inflater.inflate(R.layout.fragment_main2, container, false) | |
} | |
override fun onViewCreated(view: View?, savedInstanceState: Bundle?) { | |
super.onViewCreated(view, savedInstanceState) | |
textView = view?.findViewById<TextView>(R.id.textView) | |
Log.d("kotlinx", "onViewCreated textView ID: " + textView!!.id) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment