开发者

what is the best way to transfer back and forth between 2 activities

My application has a main form activity-1 with some <EditTexts> and a spinner, based on spinner selection, need to display another activity-2 with more form fields (multiselectable <CheckBoxes>), after开发者_如何学JAVA user submitting the 2nd activity, need to display the activity-1 to allow the user to fill remaining fields of activity-1 (if any). Finally, need to submit all the values from activity-1,2 to a webservice.

Can anybody please let me know the best way to do this.

Thanks, nehatha


From Activity-1 launch Activity-2 using startActivityForResult(intent). You can pass whatever info you want from Activity-1 to Activity-2 via intent extras using intent.putExtra() APIs. Then when Activity-2 is done, your Activity-1's onActivityResult() will be called.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜