Android

【Android Studio】Start an Activity with Slide & Fade Animation

 

 

Introduction

In this video, I’m going to share how to start an activity with slide and fade animation.
 

When calling an activity, we use startActivity method like this.

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

 

In order to make it work with slide and fade animations, you just need to add one line of code.
It’s super easy!

Hope you enjoy 🙂

 
 

Environment

Android Studio 3.4
Emulator: Nexus 5 (API 27)

 
 

Video

【Android Studio】Start an Activity with Slide & Fade Animation

 
 

Sample Code

MainActivity.java

 

activity_main.xml

 

activity_second.xml

 

ABOUT ME
Sara
Working as a freelance programmer in Japan. I try to make coding as simple as possible. Hope you enjoy coding 🙂