title: How to start two animations at same time in android?
body: <p>I have two linear layouts which I want to perform two different animation on both of these layouts and at the same time.</p>
  
  <p>Now its working in sequential manner. i.e, after completing one its starting another.</p>
  
  <p>here is my code.</p>
  
  <pre><code>    Animation inFromRight = new TranslateAnimation(
                      Animation.RELATIVE_TO_PARENT, +0.0f,
                      Animation.RELATIVE_TO_PARENT, 0.0f,
                      Animation.RELATIVE_TO_PARENT, 0.0f,
                      Animation.RELATIVE_TO_PARENT, 0.0f);
              inFromRight.setDuration(500);
              inFromRight.setInterpolator(new AccelerateInterpolator());
  
      Animation outtoLeft = new TranslateAnimation(
                      Animation.RELATIVE_TO_PARENT, 0.0f,
                      Animation.RELATIVE_TO_PARENT, -1.0f,
                      Animation.RELATIVE_TO_PARENT, 0.0f,
                      Animation.RELATIVE_TO_PARENT, 0.0f);
              outtoLeft.setDuration(500);
              outtoLeft.setInterpolator(new AccelerateInterpolator());
  
      @Override
          public void onClick(View v) {
              switch (v.getId()) {
              case R.id.menu:
                              mainLayout.startAnimation(outtoLeft);
                  sideBar.startAnimation(inFromRight);                
                  break;
              }
          }
  
  outtoLeft.setAnimationListener(new AnimationListener() {
              @Override
              public void onAnimationStart(Animation animation) {
              }
  
              @Override
              public void onAnimationRepeat(Animation animation) {
              }
  
              @Override
              public void onAnimationEnd(Animation animation) {
                  mainLayout
                          .setLayoutParams(new LayoutParams(
                                  LayoutParams.FILL_PARENT,
                                  LayoutParams.FILL_PARENT, 40));
  
              }
          });
  </code></pre>