title: Passing selected item of string array of urls in putExtra intent from activity to service
body: <p>In my media player app, I am passing selected url to my Service class like this from my list view.</p>
  
  <pre><code> Resources res = getResources();
   String[] links = res.getStringArray(R.array.links);
   String url = links[position];
  
   if (playing) {
       Intent i = new Intent(MainActivity.this, MpService.class);
       stopService(i);
   }
  
   playing = true;
  
   Intent start = new Intent(MainActivity.this, MpService.class);
   start.putExtra("media", url);
   startService(start);
  </code></pre>
  
  <p>But at my playpause toogle button i'm restarting the service where i need to keep the same url behind which is selected before.
  Here is the toogle function:  </p>
  
  <pre><code>private void togglePlayPause() {
      if (playing) {
          playing = false;
          nowplaying.setText("Offline");
          mPlayerControl.setImageResource(R.drawable.ic_play_circle_filled);
          Intent i = new Intent(MainActivity.this, MpService.class);
          stopService(i);
      } else if (!playing){
          playing = true;
          Intent i = new Intent(MainActivity.this, MpService.class);
          i.putExtra("media",//here is what i'm not getting);
          startService(i);
          nowplaying.setText("Now Playing");
          mPlayerControl.setImageResource(R.drawable.ic_pause_circle_filled);
      }
  }
  </code></pre>
  
  <p>Kindly help in how to achieve this? Its my first app and this is very confusing.</p>