Skip to content

Instantly share code, notes, and snippets.

@navczydev
Created July 10, 2021 02:02
Show Gist options
  • Save navczydev/6aee0425f1e57cb24532aa2842f5587f to your computer and use it in GitHub Desktop.
Save navczydev/6aee0425f1e57cb24532aa2842f5587f to your computer and use it in GitHub Desktop.
activityMainBinding.navigationRail?.setOnItemSelectedListener { item ->
when (item.itemId) {
R.id.alarms -> {
Toast.makeText(this, "Alarms Clicked", Toast.LENGTH_SHORT).show()
true
}
else -> {
Toast.makeText(this, "Other item clicked", Toast.LENGTH_SHORT).show()
true
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment