Thanks for the response
Methods are defined in classes, not layout files.
I am sorry that was a big typo !!Yes , i have defined the method in AddUserActivity.java , i have a button in activity_add_user.xml which should call save() method of AddActivityUser.java , based on some online help i found out that i have to create an Intent in MainActivity and then call the startActivity() method. Let me know if the approach is correct.