title: Cannot make static reference to nonstatic method
body: <p>Having trouble with static and non static methods. I have a project with three fragments. I want to launch some music from each of the three fragments. I have three radio buttons on each fragment. I put the media player in a separate class called global. I made the play routine static so I could call it from either of the fragments. I pass the filename to the play routine.</p>
  
  <p>I get <code>The method getResources() is undefined for the type Global</code>.</p>
  
  <p>Source code:</p>
  
  <pre><code>try {
              AssetFileDescriptor descriptor = getResources().getAssets().openFd(fn);
              //AssetFileDescriptor descriptor = contex.getAssets().openFd(fn);
              player.setDataSource(descriptor.getFileDescriptor(), descriptor.getStartOffset(), descriptor.getLength());
              descriptor.close();
  
  
              FileInputStream fileInputStream = new FileInputStream(this.Context.getFilesDir().getPath() + fn);
              player.setDataSource(fileInputStream.getFD());
              //player.setDataSource(fn);
              if (playing==false){
                   player.setLooping(true);
                   player.prepare();
                   player.start();
                   playing = true;
  </code></pre>
  
  <p>How can I get getResources() to work. So I can get the dataSource for the player.</p>