Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MainActivity : AppCompatActivity() {
- private val messageView : TextView by lazy {
- // runs on first access of messageView
- findViewById(R.id.message_view) as TextView
- }
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- setContentView(R.layout.activity_main)
- messageView.text = "Hello"
- }
- }
Add Comment
Please, Sign In to add comment