Can any one help me to solve this error i am getting error
attempt to invoke virtual method 'void android.widget.button.setonclicklistener(android.view.view$onclicklistener)' on a null object reference
Have you set the onclick listener before you defined the button or did you not define the button at all?
If you have defined the button already then call the onClick method after the definition or if you have not defined the button please define it before you call the noClick method on it.
If you are using a function that contains the onClick method for that specific button then please make sure you call the function after the button is defined.
Check this website for more help:
https://www.geeksforgeeks.org/handling-click-events-button-android