title: How can I start animation when mediaplayer is running. If mediaplayer is not runnning, animation also will not run
body: <pre><code>image = (ImageView) findViewById(R.id.imageView16);
          button = (Button) findViewById(R.id.btncheck);
  final MediaPlayer true_answer = MediaPlayer.create(this, 
  
  R.raw.answer_is_true);
      button.setOnClickListener(new View.OnClickListener() {
                  @Override
                  public void onClick(View view) {
                      true_answer.start();
                      if (true_answer.isPlaying()){//doesn't work
                          image.setBackgroundResource(R.drawable.anim);
                          AnimationDrawable animation = (AnimationDrawable)image.getBackground()Q;
                          animation.start();
                      }
                      image.setBackgroundResource(R.drawable.anim);
                      AnimationDrawable animation = (AnimationDrawable)image.getBackground();
                      animation.stop();
                  }
              });
  </code></pre>
  
  <p>Am I right with the function isRunning? or I should add while. I can not solve this problem. Please Help me</p>