Skip to content
Advertisement

Function “onButtonClicked” is never use

I have created a function called “onButtonClicked” and I want the button (bt301_tw) to send me to the activity (MainActivity_04_ReadioGroup).

The problem is when I create the function onButtonClicked, I can’t use it and I don’t want to use a setOnClickListener because I’m practicing with different views

My code:

XML

JavaScript

Mainactivity

JavaScript

enter image description here

Advertisement

Answer

This Works for me:

JavaScript

If you are using data binding then you can directly mention view name:

JavaScript

Hope this helps

Just to add view.id == R.id.bt301_tw This will never be same.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement