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
Comments
Post a Comment