Slide Animation Between Activites – Android Studio Tutorial

In this video we will learn, how we can add a sliding transition between activities. We will first apply them to specific activities only by using the overridePendingTransition method after starting an intent and also after calling the finish method. Then we will learn how to apply them globally to our whole app by creating a seperate theme in our styles.xml file and apply it to our app theme with the windowAnimationStyle attribute.

Source code with animation files:

⭐ Get my new MVVM Caching Course now:

❗ Subscribe to the channel:

💲 Earn money by becoming an affiliate for my courses:

📨 Subscribe to the Coding in Flow newsletter:

💻 Hire me for your next project:

💚 Donate to Coding in Flow with a message:

❓ Ask your programming questions in our chat:

📣 Follow Coding in Flow on other sites:

26 Replies to “Slide Animation Between Activites – Android Studio Tutorial”

  1. Darth Structure

    I am assuming you added the Button listener and the button code behind the scenes, and we just have to add it ourselves? Otherwise, how did you get the button to work. I don't see any code for it. I love your tutorial though!!!!!

  2. Pajeet Singh

    Holy Christ. This is so easy. No Wonder Instagram is such basic yet billion dollar app. I wonder why Facebook didn't just made one by themselves. I guess data.

  3. Serdar Gündoğdu

    public void finish() {


    overridePendingTransition(R.anim.slide_left, R.anim.slide_right_out);


    1-This is works ( while i using in finish method )


    startActivity(new Intent(getApplicationContext(), message.class));

    overridePendingTransition(R.anim.slide_right, R.anim.slide_left_out);
    2- This is works too ( in case )


    startActivity(new Intent(getApplicationContext(),MainActivity.class));

    overridePendingTransition(R.anim.slide_left, R.anim.slide_right_out);

    return true;

    3- This is not work (in case) why ?

  4. Martin _

    Can someone help me how i can make this work with the Back arrow in action bar?


  5. Aakash Kaushal

    Hello, thanks for this video tutorial. I have created a basic app and linked different activities in android studio using your techniques, and i think you have explained them in the easiest way possible. Thank you.

    Have you created a tutorial for sending information to servers via the android app? If so, please let me know. I appreciate your help.

  6. Vishal Kumar

    How to enable music button globally….like i made an app of 5 activity with background music in all activities …in 2nd page i made a button for pausing bg music but when i click that button then bg music sets off only for that page(i.e activity 2) i am unable to pause for all activities..please helppp

Leave a Reply

Your email address will not be published. Required fields are marked *