title: Starting activity on mouse click makes animation slow
body: <p>So I am developing Android application in which I have a Home screen and another screen with the content of the app. On home screen I have a button which navigates the user to the content's screen (actually it is image view but used as a button).
  When clicked this button should start animation of itself being clicked and then start the activity of the content screen.
  But it actually works pretty bad and slow, when I click the button the animation starts but it slows down (lags). I tried changing the event from click to tap and lots of other possible solutions but none worked.
  I tried commenting "startActivity" method and this fixed it, the animation was running smoothly. Obviously I need the startActivity method, so what is the best approach here, how can I fix this. Can putting startActivity in different thread work, I'm not sure how to do this if so as well</p>
  
  <p>This is my code:</p>
  
  <pre><code>((Button)findViewById(R.id.btnPlay)).setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(final View v) {
              //shake.reset();
              findViewById(R.id.btnPlay).startAnimation(shake);
  
              shake.setAnimationListener(new Animation.AnimationListener() {
                  Intent i;
  
                  @Override
                  public void onAnimationStart(Animation animation) {
                      i = new Intent(v.getContext(), GameActivity.class);
                      startActivity(i);
                  }
  
                  @Override
                  public void onAnimationEnd(Animation animation) {
                      ((Button) findViewById(R.id.btnPlay)).setVisibility(View.INVISIBLE);
                  }
  
                  @Override
                  public void onAnimationRepeat(Animation animation) {
  
                  }
              });
          }
      });
  </code></pre>
  
  <p>shake is an animation loaded from custom xml file. I have the same animation in the content screen and it runs smoothly, of course there is no startActivity there. Here is the code:</p>
  
  <pre><code>&lt;set xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  &lt;rotate
      android:duration="70"
      android:fromDegrees="-5"
      android:pivotX="50%"
      android:pivotY="50%"
      android:repeatCount="5"
      android:repeatMode="reverse"
      android:interpolator="@android:anim/linear_interpolator"
      android:toDegrees="5" /&gt;
  &lt;translate
      android:fromXDelta="-10"
      android:toXDelta="10"
      android:repeatCount="5"
      android:repeatMode="reverse"
      android:interpolator="@android:anim/linear_interpolator"
      android:duration="70" /&gt;
  </code></pre>
  
  <p></p>