android - App communication using intents with multiples activities -


i'm doing communication between 2 apps using intents. first app launch intent captured second app. in second app, have process multiples activities , @ end of process, last activity should return result caller app. in simple diagram this:

app 1 ----- launch intent -----> app 2 activity1                                  app 2 activity2                                  app 2 activity3 app1 <----- intent response ---- app 2 activity4 onactivityresult 

i suppose in case, app2 activity1 should activity in charge respond app1, reason have tried "empty stack" app2 activity 4 using intent.flag_activity_new_task | intent.flag_activity_clear_task i'm not able "kill" app2 app2 activity1, , come app2 activity3.

i have thought alternative start each activity on app2 waiting result , app2 activity 4 init notification chain activity 4 activity 1 feel option have strange behaviors if user start go ahead , through activities... :s

any idea achieve send information app1 app2?

thanks.

finally found solution problem, simple as, relaunch app2 activity1 using intent.flag_activity_clear_top , returning process result included in intent.

finally in order return information app1, app2 activity1 if intent includes result information, set intent result , finish it.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -