Reputation: 191
I want to use authSwitch
, which is a switch in custom layout file. I have inflated it and can access the switch inside IntroActivity.kt
but the interaction doesn't seem to be reflected when interacted with it. How can I access the changes done to that switch without it using inside setContentView? I need ActivityIntroBinding
which houses a pageviewer displaying different fragments in which one fragment contains the authSwitch
.
binding = ActivityIntroBinding.inflate(layoutInflater)
authBinding = IntroPageFourBinding.inflate(layoutInflater)
setContentView(binding.root)
authBinding.authSwitch.setOnClickListener {
SharedFunctions().showToast(baseContext, "Pressed")
}
Upvotes: 0
Views: 31