title: Android: How to switch between 2 ImageView using fade in and fade out
body: <p>I'm trying to perform an alpha animation between two images by clicking on each of them, but when I click on the first image nothing happens.</p>
  
  <p>I set alpha for <code>spotlight view</code> so that it will be always invisible.</p>
  
  <p>Here is my function I wrote in Java:</p>
  
  <pre><code>public void fade_1(View view) {
      ImageView revenant = (ImageView) findViewById(R.id.revenant);
      ImageView spotlight = (ImageView) findViewById(R.id.spotlight);
  
      revenant.animate().alpha(0f).setDuration(2000);
      spotlight.animate().alpha(1f).setDuration(2000);
  }
  
  public void fade_2(View view) {
  
      ImageView spotlight = (ImageView) findViewById(R.id.spotlight);
      ImageView revenant = (ImageView) findViewById(R.id.revenant);
  
      spotlight.animate().alpha(0f).setDuration(2000);
      revenant.animate().alpha(1f).setDuration(2000);
  }
  </code></pre>