Paste date from the intent activity

0

I am setting the information like this in my intent, but I need to recover if I return to the screen. how to do?

Intent data = new Intent();
data.putExtra("OPCIONAIS", (Serializable) listaOpcionais);
setResult(RESULT_OK, data);

I need to retrieve and put in the listaOpcionais variable. I need to do this so that once it reaches the screen, it reloads 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 at line listaOpcionais = data.getStringExtra("resultado"); it is expecting an array and not a string

    
asked by anonymous 30.05.2017 / 22:50

0 answers