I have a DataActivity
which has to ask the user to fill out a form and then return the data to MainActivity
DataActivity
is called from MainActivity
like this :
Intent i = new Intent();
i.setClass(this, DataActivity.class);
startActivityForResult(i,RESULT_OK);
DataActivity
should return data intent to MainActivity
like this :
Intent i = new Intent();
i.putExtra("funcX", ((EditText)findViewById(R.id.data_eq_x)).getText().toString());
i.putExtra("funcY", ((EditText)findViewById(R.id.data_eq_y)).getText().toString());
i.putExtra("constants", (Serializable)constants);
setResult(RESULT_OK,i);
finish();
but onActivityResult
is never called in MainActivity
after this...
Whenever i try to access funcX
or funcY
in MainActivity
, I get NullPointerexception.
NOTE: constants
variable can be and in fact was null when i was testing this code.
I'm developing on Android 2.2 on the emulator.