title: Android Studio - Animations between activities
body: <p>I'm doing a &quot;University Chat App&quot;. The first activity of the app is just the logo and the second activity is the sign in. I want to add a small fade from the first activity to the second activity.</p>
  <p>This is the code for the fade in:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;set xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&gt;
  &lt;alpha android:fromAlpha=&quot;0.5&quot;
      android:toAlpha=&quot;1.0&quot;
      android:interpolator=&quot;@android:anim/accelerate_interpolator&quot;
      android:duration=&quot;9000&quot; /&gt;
  &lt;/set&gt;e
  </code></pre>
  <p>This is the code for the fade out:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;set xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&gt;
  &lt;alpha android:fromAlpha=&quot;1.0&quot;
       android:toAlpha=&quot;0.0&quot;
       android:interpolator=&quot;@android:anim/accelerate_interpolator&quot;
       android:fillAfter=&quot;true&quot;
       android:duration=&quot;1000&quot; /&gt;
  &lt;/set&gt;
  </code></pre>
  <p>MainActivity code:</p>
  <pre><code>public class MainActivity extends AppCompatActivity {
  
  private static int WELCOME_TIMEOUT = 1500; // Sets time of the transition
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      getSupportActionBar().hide(); // Hide Action Bar
      getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); // Hide the Status Bar
      setContentView(R.layout.activity_main);
  
  new Handler().postDelayed(new Runnable() {
      @Override
      public void run() {
          Intent welcome = new Intent(MainActivity.this, MainActivity2.class);
          startActivity(welcome);
          overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
          finish();
      }
  }, WELCOME_TIMEOUT);
  }
  }
  </code></pre>
  <p>Everything works fine, but the fade out is quite slow and it creates this transparent gray screen before changing to the second activity. I'm assuming the gray screen comes from this line of the fade out <code>android:toAlpha=&quot;0.0&quot;</code></p>
  <p>Is there a way to create a better fade between activities, without the transparent gray screen? Also, can different animations be done in between activities?</p>