score:0

i think you should add an action action_send to your intent to return to the other activity. something like this:

intent i = getintent();
**i.setaction(intent.action_send);**
i.putextra("pedido", cpedpedido);
i.putextra("vlrfrete", valorfrete);
setresult(result_ok, i);
finish();

score:0

use:

intent i = this.getintent();

instead of

intent i = getintent();

in the activity where you need to receive data of the intent, which has the values binded to some keys.

score:1

i figured out the solution for my problem:

i dont know why but if i move this piece of code that is actually on buttonclick event on activity b(2):

intent i = getintent();
i.putextra("pedido", cpedpedido);
i.putextra("vlrfrete", valorfrete);
setresult(result_ok, i); //result_ok is a native constant that have value -1
finish();

to -> right after oncreate, it works ok.

but if i move back this code "to the right place" on a button click, it doesnt work, i really dont know why the activity is having this very weird behaviour, but i'll be happy to share when i figure it out.

in other words, i have to set the extras and the result_ok before doing anything, otherwise it didnt work.


Related Query

More Query from same tag