Pick up date from Intent Activity

Asked

Viewed 65 times

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

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.