android invoke another apk and get a return result -


i integrating 2 different apks logic pretty simple:

app calls app b passing amount app b receives request if app b's "active" activity in (main) activity c set amount allow user process amount once done processing return transaction number app else return result_canceled app a

given can can call app b via startactivityforresult, but:

  1. what happens in app b when (main) activity c launched when application left sitting in activity d? how detect in middle of activity d in order fail , return result_canceled?
  2. in normal processing want return resulting transaction number caller, i've tried passing intent extras in setresult, intent returned app null.

does have simple example of this?

you can use startactivityforresult() if both calling activity , called activity run in same task. otherwise startactivityforresult() generate immediate call onactivityresult() result_canceled.

given above premise, if app starts app b using startactivityforresult(), create new instance of app b's main activity, , therefore not possible app b in other state.

if 2 apps running in different tasks, need communicate between them using other mechanisms (broadcast intents, background services, shared files, or similar).


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -