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.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.