title: Sound starts over and over again
body: <p>I have a property that is set like this:</p>
  <pre class="lang-java prettyprint-override"><code>private MediaPlayer _standBy = null;
  </code></pre>
  <p>Now I would like to use that property in my function <code>playSound()</code>.</p>
  <pre class="lang-java prettyprint-override"><code>private void playSound() {
          if (_standBy == null || !_standBy.isPlaying()) {
              _standBy = MediaPlayer.create(_context, R.raw.turbine);
              _standBy.start();
          }
  }
  </code></pre>
  <p>That function will be executed whenever I click on a button and the sound should be played only once, no matter how many times I click on that button. Well, that works fine. But since I am repeating that code over and over again but with different properties, I would like to paste that code into another function. That's how I tried it:</p>
  <pre class="lang-java prettyprint-override"><code>private void customizeSound(MediaPlayer mediaplayer) {
          if (mediaplayer== null || !mediaplayer.isPlaying()) {
              mediaplayer= MediaPlayer.create(_context, R.raw.turbine);
              mediaplayer.start();
          }
  }
  </code></pre>
  <p>So now <code>playSound()</code> looks like this:</p>
  <pre class="lang-java prettyprint-override"><code>private void playSound() {
          customizeSound(_standBy);
  }
  </code></pre>
  <p>And now when I click on that button, the function customizeSound(_standBy) will be executed but the same sound will be started every time when I click on that button.</p>
  <p>What's wrong with my code?</p>