开发者

Is it possible to use Intent to update a value in another activity?

I want to pass a value from one Activity to ano开发者_StackOverflow中文版ther 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?


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜