title: 'Unexpexted Symbol &' and 'Cannot resolve symbol amp'
body: <p>This line of code is giving me trouble in android studios</p>
  
  <pre><code>if(musicSrv!=null &amp;amp;&amp;amp; musicBound &amp;amp;&amp;amp; musicSrv.isPng())
  </code></pre>
  
  <p>The code came from this tutorial I found: <a href="http://code.tutsplus.com/tutorials/create-a-music-player-on-android-project-setup--mobile-22764" rel="nofollow">Music Player</a></p>
  
  <p>the full class code is:</p>
  
  <pre><code>package com.tunein.bryantyoung.tunein;
  
  import android.app.Activity;
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import java.util.ArrayList;
  import java.util.Collections;
  import java.util.Comparator;
  import android.net.Uri;
  import android.content.ContentResolver;
  import android.database.Cursor;
  import android.widget.ListView;
  import android.os.IBinder;
  import android.content.ComponentName;
  import android.content.Context;
  import android.content.Intent;
  import android.content.ServiceConnection;
  import android.view.MenuItem;
  import android.view.View;
  import com.tunein.bryantyoung.tunein.MusicService.MusicBinder;
  import android.widget.MediaController.MediaPlayerControl;
  
  public class MainActivity extends Activity implements MediaPlayerControl {
      private ArrayList&lt;Song&gt; songList;
      private ListView songView;
      private MusicController controller;
      private MusicService musicSrv;
      private Intent playIntent;
      private boolean musicBound=false;
      private boolean paused=false, playbackPaused=false;
  
      /**
       * Override methods
       */
      @Override
      public void start() {
          musicSrv.go();
      }
  
      @Override
      public void pause() {
          playbackPaused=true;
          musicSrv.pausePlayer();
      }
  
      @Override
      public int getDuration() {
          if(musicSrv!=null &amp;amp;&amp;amp; musicBound &amp;amp;&amp;amp; musicSrv.isPng())
              return musicSrv.getDur();
          else return 0;
      }
  
      @Override
      public int getCurrentPosition() {
          if(musicSrv!=null &amp;amp;&amp;amp; musicBound &amp;amp;&amp;amp; musicSrv.isPng())
          return musicSrv.getPosn();
          else return 0;
      }
  
      @Override
      public void seekTo(int pos) {
          musicSrv.seek(pos);
      }
  
      @Override
      public boolean isPlaying() {
          if(musicSrv!=null &amp;amp;&amp;amp; musicBound)
              return musicSrv.isPng();
          return false;
      }
  
      @Override
      public int getBufferPercentage() {
          return 0;
      }
  
      @Override
      public boolean canPause() {
          return true;
      }
  
      @Override
      public boolean canSeekBackward() {
          return true;
      }
  
      @Override
      public boolean canSeekForward() {
          return true;
      }
  
      @Override
      public int getAudioSessionId() {
          return 0;
      }
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          songView = (ListView)findViewById(R.id.song_list);//retrieves the list view using ID
          songList = new ArrayList&lt;Song&gt;();//instantiates list view
          getSongList();
          Collections.sort(songList, new Comparator&lt;Song&gt;() {
              public int compare(Song a, Song b) {
                  return a.getTitle().compareTo(b.getTitle());
              }
          });
          SongAdapter songAdt = new SongAdapter(this, songList);
          songView.setAdapter(songAdt);
          setController();
      }
  
      @Override
      protected void onStart() {
          super.onStart();
          if(playIntent==null){
              playIntent = new Intent(this, MusicService.class);
              bindService(playIntent, musicConnection, Context.BIND_AUTO_CREATE);
              startService(playIntent);
          }
      }
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          //menu item selected
          switch (item.getItemId()) {
              case R.id.action_shuffle:
                  musicSrv.setShuffle();
                  break;
              case R.id.action_end:
                  stopService(playIntent);
                  musicSrv=null;
                  System.exit(0);
                  break;
          }
          return super.onOptionsItemSelected(item);
      }
  
      @Override
      protected void onDestroy() {
          stopService(playIntent);
          musicSrv=null;
          super.onDestroy();
      }
  
      @Override
      protected void onPause(){
          super.onPause();
          paused=true;
      }
  
      @Override
      protected void onResume(){
          super.onResume();
          if(paused){
              setController();
              paused=false;
          }
      }
  
      @Override
      protected void onStop() {
          controller.hide();
          super.onStop();
      }
  
  
      /**
       * Helpers
       */
  
      //connect to the service
      private ServiceConnection musicConnection = new ServiceConnection(){
  
          @Override
          public void onServiceConnected(ComponentName name, IBinder service) {
              MusicBinder binder = (MusicBinder)service;
              //get service
              musicSrv = binder.getService();
              //pass list
              musicSrv.setList(songList);
              musicBound = true;
          }
  
          @Override
          public void onServiceDisconnected(ComponentName name) {
              musicBound = false;
          }
      };
  
      public void getSongList() {
          //retrieve song info
          ContentResolver musicResolver = getContentResolver();
          Uri musicUri = android.provider.MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
          Cursor musicCursor = musicResolver.query(musicUri, null, null, null, null);
  
          //Iterate over the results
          if(musicCursor!=null &amp;&amp; musicCursor.moveToFirst()){
              //get columns
              int titleColumn = musicCursor.getColumnIndex
                      (android.provider.MediaStore.Audio.Media.TITLE);
              int idColumn = musicCursor.getColumnIndex
                      (android.provider.MediaStore.Audio.Media._ID);
              int artistColumn = musicCursor.getColumnIndex
                      (android.provider.MediaStore.Audio.Media.ARTIST);
              //add songs to list
              do {
                  long thisId = musicCursor.getLong(idColumn);
                  String thisTitle = musicCursor.getString(titleColumn);
                  String thisArtist = musicCursor.getString(artistColumn);
                  songList.add(new Song(thisId, thisTitle, thisArtist));
              }
              while (musicCursor.moveToNext());
          }
      }
  
      public void songPicked(View view){
          musicSrv.setSong(Integer.parseInt(view.getTag().toString()));
          musicSrv.playSong();
          if(playbackPaused){
              setController();
              playbackPaused=false;
          }
          controller.show(0);
      }
  
      private void setController(){
          //set the controller up
          controller = new MusicController(this);
  
          //Click listeners for next and Prev
          controller.setPrevNextListeners(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  playNext();
              }
          }, new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  playPrev();
              }
          });
  
          controller.setMediaPlayer(this);
          controller.setAnchorView(findViewById(R.id.song_list));
          controller.setEnabled(true);
      }
  
      //play next
      private void playNext(){
          musicSrv.playNext();
          if(playbackPaused){
              setController();
              playbackPaused=false;
          }
          controller.show(0);
      }
  
      //play prev
      private void playPrev(){
          musicSrv.playPrev();
          if(playbackPaused){
              setController();
              playbackPaused=false;
          }
          controller.show(0);
      }
  
  }
  </code></pre>
  
  <p>The Code is the main activity for a music player app the line that im having problems with is suppose to be a conditional statement but I my self am not sure how it works I haven't made similar statements before.</p>