title: How to use setters and getters to pass data between classes in android
body: <p>I'm writing a program that has two classes, one that extends Activity and another that extends  SurfaceView. The activity has an object of the SurfaceView class. I am trying to use setters and getters to send data between these two classes, but every time I try, eclipse says that the methods for setting and getting need to be static. I can't do this because I don't want them to be static. </p>
  
  <p>The Activity class contains the following methods:</p>
  
  <pre><code>public float getxTouch(){
  return xTouch;
  }
  public float getyTouch(){
  return yTouch;
  }
  </code></pre>
  
  <p>The SufaceView class contains the following code:</p>
  
  <pre><code>xpos = ActivityClass.getxTouch();
  ypos = ActivityClass.getyTouch();
  </code></pre>
  
  <p>How might I fix this without making the methods static?</p>