How to switch between Activities in Android

To switch Menus/Activities in Android App

  1. I called this function in XML file as android:onClick=”backToMainMenu” in the attributes of button.
  2. The function must be public and have only one attribute i.e. “View view”
  3. You can call “i” whatever you wish.
  4. “PreviousMenuClassName” is the name of the Activity where you want to go after clicking the button.
Liked it? Take a second to support codeonion on Patreon!

Leave a Reply

Your email address will not be published.