Skip to content

Instantly share code, notes, and snippets.

@arifvn
Last active November 15, 2020 10:22
Show Gist options
  • Save arifvn/fedba40486fedcb06acb2b62f799864d to your computer and use it in GitHub Desktop.
Save arifvn/fedba40486fedcb06acb2b62f799864d to your computer and use it in GitHub Desktop.
class MainActivity : AppCompatActivity() {
private val tvUsername: TextView by lazy { findViewById(R.id.tv_username) }
private var text: String by Delegates.observable("Initial Value") { property, oldvalue, newValue ->
tvUsername.text = newValue
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
text = "Value has changed"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment