title: How do I get a variable from another class in Java?
body: <p>How do I set selectedPlayer to the value of position from my other class?</p>
  
  <p>I've read a bunch of similar questions on here, but I keep running into conflicts with my variables and functions.</p>
  
  <p>ScoreList.java</p>
  
  <pre><code>public class ScoreList extends Activity {
  
      Integer selectedPlayer = 0;
  }
  </code></pre>
  
  <p>ScoreListAdapter.java</p>
  
  <pre><code>public class ScoreListAdapter extends ArrayAdapter&lt;Score&gt; {
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
  
          final OnClickListener lsScoreView = new OnClickListener() {
                @Override
                  public void onClick(View v) {
                    //send position to main class here
                }
          };
  
      }
  }
  </code></pre>