title: Accessing a List from another class
body: <p>I'm working on an audio player. I have a fragment called <strong>HomeFragment</strong> which shows the lists of the songs. When I press one of the songs an activity called <strong>SongDetailActivity</strong> opens and there is a play button called <strong>play_fab</strong> inside it. I want to create a notification when I press this play button.</p>
  
  <p>I have the song lists inside the <strong>DataSource.java</strong>. </p>
  
  <p>My problem is in this line </p>
  
  <p><strong>SongDetailActivity</strong>:</p>
  
  <pre><code>CreateNotification.createNotification(SongDetailActivity.this, lstSongs.get(1),R.drawable.ic_pause_black_24dp,1,lstSongs.size()-1);
  </code></pre>
  
  <p>lstSongs is colored red, I can't reach it. What should I do to reach lstSongs. Can somebody help please?</p>
  
  <p>My codes:</p>
  
  <p><strong>SongDetailActivity.java</strong></p>
  
  <pre><code> @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_song_detail);
  
      if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.O) {
          createChannel();
      }
  
  
      play_fab.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              CreateNotification.createNotification(SongDetailActivity.this, lstSongs.get(1),R.drawable.ic_pause_black_24dp,1,lstSongs.size()-1);
          }
      });
  </code></pre>
  
  <p><strong>DataSource.java</strong></p>
  
  <pre><code>public class DataSource {
  
  public static List&lt;Song&gt; getMusic(){
  
      List&lt;Song&gt; lstSongs = new ArrayList&lt;&gt;();
      lstSongs.add(new Song("Title1","Artist1", R.drawable.cover1,"Category Name 1"));
      lstSongs.add(new Song("Title2","Artist2",R.drawable.cover2,"Category Name 2"));
      lstSongs.add(new Song("Title3","Artist3",R.drawable.cover3,"Category Name 3"));
      lstSongs.add(new Song("Title4","Artist4",R.drawable.cover4,"Category Name 4"));
      lstSongs.add(new Song("Title5","Artist5",R.drawable.cover5,"Category Name 5"));
      lstSongs.add(new Song("Title6","Artist6",R.drawable.cover6,"Category Name 6"));
      lstSongs.add(new Song("Title7","Artist7",R.drawable.cover7,"Category Name 7"));
  
      return lstSongs;
  
  }
  </code></pre>