title: Create a global instance of an object within Android Studio App
body: <p>I am designing a Game in Android Studio. I have an activity with multiple fragments on it. I also have a Player object that I want to create an instance of.</p>
  
  <pre><code>Player player1 = new Player();
  </code></pre>
  
  <p>All these fragmenets on my activity will be making changes to <code>player1.</code>
  Instead of passing this object to each Fragment and successive activity with:</p>
  
  <pre><code>intent.putExtra("Player",player1);
  </code></pre>
  
  <p>is there a way to access player1 from other fragments and activities without going through the trouble of passing it with the <code>putExtra()</code> method?</p>
  
  <p>I tried making player1 static:</p>
  
  <pre><code>static Player player1 = new Player();
  </code></pre>
  
  <p>but, i couldnt access <code>player1</code> from other <code>.java</code> activity files.</p>
  
  <p>So, basically, I want a strategy to make <code>player1</code> a GLOBAL object that I can reference whenever and wherever. I don't want to make all the methods within the Player class static, because I want to be able to have <code>player1</code>, <code>player2</code>, and <code>player3</code> files on my game, so I need to be able to create an instance of a <code>Player</code>, and I don't think it can be done if every method was static (right?)</p>
  
  <p>I just started OOP, so I am sure there's something simple that I am overlooking, or perhaps rather than messing with modifiers there is a better way to achieve what I want. Maybe by using an interface? How would an interface work?</p>
  
  <p>What about storing info in the Application Object by creating a class that <code>extends Application</code>? </p>