Passing string from class to main activity
<p>I'm trying to pass something from one class to my MainActivity, but it doesn't seem to work, I don't understand why.
I have my GPS Tracker on another class (not the MainActivity) in order to reuse it.
When the location changes, I want my other class to call a method from within the MainActivity to update my UI.</p>

<p>I summarized my code like that :</p>

<pre><code> My MAIN ACTIVITY :

public class MainActivity extends Activity implements OnClickListener {

TextView tv;
EditText et;
Button btun;
int arg0;
int stuff;

 @Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    tv = (TextView) findViewById(R.id.tv);
    et = (EditText) findViewById(R.id.et);
    btun = (Button) findViewById(R.id.btun);
    btun.setOnClickListener(this);
}

private void setter(int stuff) {
    tv.setText(stuff);
}

public void setText(int _stuff) {
    _stuff = stuff;
    setter(_stuff);
}

@Override
public void onClick(View v) {
    Getter get = new Getter();
    get.getInfo(Integer.parseInt(et.getText().toString()));
}
</code></pre>

<p>The other Class :</p>

<pre><code>public class Getter {

int _getString;
MainActivity main = new MainActivity();

public void getInfo(int getString) {
    _getString = getString * 8;
    main.setText(_getString);
    }
}
</code></pre>

<p>I end up having a NullPointerException in my LogCat
at :</p>

<pre><code>- tv.setText(stuff);
- setter(_stuff);
- main.setText(_getString);
- get.getInfo(Integer.parseInt(et.getText().toString()));
</code></pre>

<p>and I don't really know why, and above all, how to fix it.</p>

<p>I'll appreciate any help !</p>

<p>(PS : My GPS tracker thingy is working fine, it's just about invoking my setter() method.</p>
