I have parent activity with drawerlayout, in it's xml I put dashboard layout using include tag and in xml of this dashboard layout I put 'MainActivity' using include tag again. In the xml of MainActivity there is button, for which in onclick I put some logic in MainActivity.java. Problem is button is rendering, but click is not working anyway
- I want to write business logic for click in MainActivity.java, that button which is in xml of MainActivity.xml.
- Button click must work in this way
Suppose, You have used <include tag in ParentActivty and you have given id as "@+id/layout_button" And also in ChildActivity you have given Button id as "@+id/button"
If you use "viewbinding" in your codebase then you can get the reference of this button by calling binding.layoutButton.button