I have 4 activities
in which I enter data and I want to receive the same data in a single activity
.
First data logging activity:
Intent Register = new Intent(this,Window_Configuracion.class);
etConstanteK = (EditText)findViewById(R.id.txtConstanteK);
etDC = (EditText)findViewById(R.id.txtDC);
Register.putExtra("K_To_Objetivo",etConstanteK.getText().toString() );
Register.putExtra("DC_To_Objetivo",etDC.getText().toString() );
Toast toastconfirmed = Toast.makeText(getApplicationContext(),
"Se han registrado exitosamente las variables", Toast.LENGTH_SHORT);
toastconfirmed.show();
startActivity(Register);
Second data logging activity:
Intent Register = new Intent(this, Window_Configuracion.class);
etHP = (EditText)findViewById(R.id.txtHP);
etDEG = (EditText)findViewById(R.id.txtDEG);
Register.putExtra("HP_To_Objetivo",etHP.getText().toString() );
Register.putExtra("DEG_To_Objetivo",etDEG.getText().toString() );
Toast toastconfirmed = Toast.makeText(getApplicationContext(),
"Se han registrado exitosamente las variables", Toast.LENGTH_SHORT);
toastconfirmed.show();
startActivity(Register);
Third data logging activity:
Intent Register = new Intent(this, Window_Configuracion.class);
etGravedad = (EditText)findViewById(R.id.txtGravedad);
Register.putExtra("Gravedad_To_Objetivo",etGravedad.getText().toString() );
Toast toastconfirmed = Toast.makeText(getApplicationContext(),
"Se ha registrado exitosamente la variable", Toast.LENGTH_SHORT);
toastconfirmed.show();
startActivity(Register);
Fourth data logging activity:
Intent Register = new Intent(this, Window_Configuracion.class);
etMasa = (EditText)findViewById(R.id.txtMasa);
Register.putExtra("Masa_To_Objetivo",etMasa.getText().toString() );
Toast toastconfirmed = Toast.makeText(getApplicationContext(),
"Se ha registrado exitosamente la variable", Toast.LENGTH_SHORT);
toastconfirmed.show();
startActivity(Register);
Activity where I need to get all the data:
Bundle datos = getIntent().getExtras();
txtConstanteK = datos.getString("K_To_Objetivo");
txtDC = datos.getString("DC_To_Objetivo");
txtGravedad= datos.getString("Gravedad_To_Objetivo");
txtHP = datos.getString("HP_To_Objetivo");
txtDEG = datos.getString("DEG_To_Objetivo");
txtMasa = datos.getString("Masa_To_Objetivo");
I use the bundle
method but it always marks me error.