tags:

views:

15

answers:

1

I want to pass a value from one Activity to another to update an integer. So basically I want Activity2 to send Activity1 a value it has garnered from user input. Seems like it should be simple just not sure how. Is it possible to run a function from another Activity and give it this value as an argument?

+1  A: 

Have Activity1 use startActivityForResult() to start up Activity2. Have Activity2 call setResult() before finish()-ing. Have Activity1 override onActivityResult() to get the result.

CommonsWare