How to switch between Activities in Android

To switch Menus/Activities in Android App

I called this function in XML file as android:onClick=”backToMainMenu” in the attributes of button. The function must be public and have only one attribute i.e. “View view” You can call “i” whatever you wish. “PreviousMenuClassName” is the name of the Activity where you want to go after clicking the