I have a header view which contains 4 buttons. When I click each of these 4 buttons it should start four different activities. And also I want these buttons in every view of my application.
I can include this header view using include tag. But how can I include the java code (button click etc) in every activities?
Thank you
Make a separate class which will get the buttons as parameters and which will create and set the appropriate onClick listeners. Then just call the class from where you need. Like this:
in your activity: