I keep getting a runtime error when launching my activity and it says android.widget.textview cannot be cast to android.widget.button?
XML:
I just encountered the same problem. However, i decided to use only "View" without casting. It works perfectly. "setOnClickListener" works the same for our case.
e.g. View button = v.findViewById(button_id); button.setOnClickListener(...)
View button = v.findViewById(button_id); button.setOnClickListener(...)