0
I am setting the information like this in my Home, but I need to recover case back to screen. how to do ?
Intent data = new Intent();
data.putExtra("OPCIONAIS", (Serializable) listaOpcionais);
setResult(RESULT_OK, data);
I need to recover and put in the variable listaOpcionais
. I need to do this so as soon as I get to the screen, it recharges the options that are in memory.
The method I need to get the data is this:
@AfterViews
public void init(Intent data) {
mToolbar = (Toolbar) findViewById(R.id.toolbar_actionbar);
setSupportActionBar(mToolbar);
getSupportActionBar().setDisplayShowHomeEnabled(true);
comida = (Comida) getIntent().getSerializableExtra(COMIDA);
tamanho = (Tamanho) getIntent().getSerializableExtra(TAMANHO);
restaurante = (Restaurante) getIntent().getSerializableExtra(RESTAURANTE);
listaOpcionais = data.getStringExtra("resultado");
configurarOpcionais();
}
But on the line listaOpcionais = data.getStringExtra("resultado");
it is expecting an array and not a string
The question is not very clear. See if this is what you are looking for How to return data from Call Activity to the one who called it?
– ramaral
@ramaral is exactly this, but mine is in init Scope, how to do?
– Renan Rodrigues
I saw that in the example it has in the method onActivityResult, I need to recover in init
– Renan Rodrigues
@ramaral updated my question
– Renan Rodrigues