title: Use animation when changing activity
body: <p>I would like to use a right-to-left sliding animation when transitioning between two activities. So far, I have set up a command to pass to the next activity.</p>
  
  <pre><code>public void advancenext (View view) {
          Intent intent = new Intent(Prompt1.this, Prompt2.class);
          Prompt1.this.startActivity(intent);
  }
  </code></pre>
  
  <p>However, I am having trouble incorporating the animation into this code. This is what I have so far for the <code>translation</code> animation</p>
  
  <pre><code>Animation set = new AnimationSet(true);
  Animation animation = new AlphaAnimation(0.0f, 1.0f);
  animation.setDuration(100);
    set.addAnimation(animation);
  
    animation = new TranslateAnimation(
        Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f,
        Animation.RELATIVE_TO_SELF, -1.0f, Animation.RELATIVE_TO_SELF, 0.0f
    );
    animation.setDuration(500);
    set.addAnimation(animation);
  
    LayoutAnimationController controller =
        new LayoutAnimationController(set, 0.25f);
  </code></pre>
  
  <p>How would I go about combining the animation information with the activity change?</p>
  
  <p>Thanks in advance   </p>