I'm trying to send data between activities using:
on Activity 2
Bundle bloc = new Bundle();
bloc.putString("DataLoc", et1.getText().toString());
Intent intent = new Intent(this, Activity2.class);
intent.putExtras(bloc);
on Activity 1
Intent iinf = getIntent();
Bundle binf = iinf.getExtras();
if (binf != null) {
String data = binf.getString("DataInf");
tv_1.setText(data);
tv_1.setText(getIntent().getExtras().getString("DataInf"));
}// end if
My Problem
I'm on Activity2
(with Activity1 under Activity2
opened), when I press back button I need show bundle on one TextView, EditText or similar but only I get to show onCreate
method.
I try using onResume
and onRestart
but... impossible.
Any suggestions?