Move one Activity to Another Activity in Android

In this post we learn How to move one Activity to Another Activity.

  • Firstly you create two different Activities like I am create two Activities MainActivity and Second two file are created.
  • After that You also enter the second file name into the MainFest.xml file for enter the name of second file name .
     
    •  This prevent your app for crash.
       
    Now we enter the code for move one activity to another

     



  • The main code is Intend class to move one activity to another activity.
    example:
    Intent in=new Intent(getBaseContext(), yourSecond Class name.class);
    startActivity(in);



    This code is implement on the main Activity.like I am used it to MainActivity.java file.

Comments

AddThis