title: Android MediaPlayer not playing when switching from Activity to Fragment
body: <p>I have a problem with the MediaPlayer on android, im starting a service that uses a custom implementer where I have all methods to use the media player, pause, play, etc</p>
  
  <p>Player working fine in activity, but it has a button to minimize it because you can keep listening to the audio on every activity so I have to start or resume the audio on a BaseFragment that I create on BaseActivity, but its not resuming the audio.</p>
  
  <p>when I close the activity of the media player I pause the player and I unregister the player service like this </p>
  
  <pre><code>AudioPlayerService.unRegister(this);
  </code></pre>
  
  <p>this is how im connecting on the BaseFragment to the service </p>
  
  <pre><code>//Connection with a service
  private ServiceConnection mConnection = new ServiceConnection() {
      @Override
      public void onServiceConnected(ComponentName name, IBinder service) {
  
          Log.d("&gt;&gt;&gt;&gt;&gt;", "Service starts on fragment");
          AudioPlayerService.LocalBinder mLocalBinder = (AudioPlayerService.LocalBinder) service;
          audioServiceObject = mLocalBinder.getService();
          mBounded = true;
  
          if (audioServiceObject != null) {
              audioServiceObject.startAudioPlayer(audio_path, media_length);
              AudioPlayerService.register(this);
              audioServiceObject.pauseAudioPlayer();
          }
      }
  
      @Override
      public void onServiceDisconnected(ComponentName name) {
          Log.d("&gt;&gt;&gt;&gt;&gt;", "Service end");
          mBounded = false;
          audioServiceObject = null;
      }
  }; 
  </code></pre>
  
  <p>I call the bottom player on BaseActivity</p>
  
  <pre><code>PlayerBottom newAudioPlayer = new PlayerBottom();
      FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
      transaction.add(R.id.audioPlayerFrame, newAudioPlayer);
      transaction.commit();
  </code></pre>
  
  <p>and im sending to the bottom player the position where it was left of when the activity was minimized, so I call the MediaPlayer.seekto and pass where it was left of so it can start there.</p>