Q:

Passing string from class to main activity

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. 
I summarized my code like that :
 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()));
}

The other Class :
public class Getter {

int _getString;
MainActivity main = new MainActivity();

public void getInfo(int getString) {
    _getString = getString * 8;
    main.setText(_getString);
    }
}

I end up having a NullPointerException in my LogCat
at :
- tv.setText(stuff);
- setter(_stuff);
- main.setText(_getString);
- get.getInfo(Integer.parseInt(et.getText().toString()));

and I don't really know why, and above all, how to fix it. 
I'll appreciate any help ! 
(PS : My GPS tracker thingy is working fine, it's just about invoking my setter() method. 

A:

Instantiaing an Object of MainActivity doesn't automatically call onCreate method but this method is called when you start an activity using Intent; And using the same intent you can pass extra values.  For example:
Intent intent = new Intent(context, MainActivity.class);
intent.putExtra("key", value);
context.startActivity(intent);

and then in your main activity onCreate method:
String value = getIntent.getStringExtra("key");

Edit: 
In your case why don't you change your void getInfo(int getString) to return a String value i.e.
public class Getter {
...
...

    public String getInfo(int getString) {
        _getString = getString * 8;
        return Integer.toString(_getString);
    }
}

and then in onClick event of MainActivity bind this returned text to TextView

