How to open intent and add value android -


i have trouble returning value intent in android. situation: have activity a, opened when start application. when click on button start activity b. in activity b fill in edittext , return string. click on button in activity b return activity a. don't know method should use in activity use value returned activity b.

this kind of situation fits startactivityforresult , onactivityforresult. when press on button, instead of calling startactivity call startactivityforresult in order start activityb. in activityb when click on button, have fill intent values want return activitya and, in order, call setresult(result, intent) , finish(). onactivityresult of activitya receive intent data

activity docs


Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -