Skip to content

Instantly share code, notes, and snippets.

@adesamp
Last active March 29, 2021 03:07
Show Gist options
  • Save adesamp/f6d8e0a313b0a9c7b4053718926e016b to your computer and use it in GitHub Desktop.
Save adesamp/f6d8e0a313b0a9c7b4053718926e016b to your computer and use it in GitHub Desktop.
DataStore sync same like this, no need changes
class MainActivity : AppCompatActivity() {
private lateinit var bmiBrain: BmiBrain
// initialize class
bmiBrain = BmiBrain(this)
// load value
binding.apply {
edtName.setText(bmiBrain.name)
}
// save value
bmiBrain.name = edtName.text.toString()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment