5

There are two Android applications calling each other: App1, App2.

steps:

  1. start App1 from Android desk. -->

  2. start startActivity(intent) or startActivityForResult(intent,0) to App2 from App1. -->

  3. start startActivity(intent) or startActivityForResult(intent,0) again to App1 from App2. -->

  4. start ( ? ) to go back to app1(activity) or App2.

I woud like make a dialog to let user to choice back to App1 or App2 in step 4. Is it possible to complete it ?

I have had tried the article here and it just back to the activity on App1 only.

Thanks for any suggestion !

Community
  • 1
  • 1
cmh
  • 271
  • 1
  • 4
  • 17

1 Answers1

4

You should override onActivityResults of the activity in App1, and if the user chooses App2, simply call finish on the activity.

MByD
  • 135,866
  • 28
  • 264
  • 277
  • Binyamin, thanks for your quick feed back. And I will try the soulution today to see if it can meet the expections. – cmh May 17 '12 at 05:40
  • There was the OnActivityResults method existed in App1 for other calling intent use. But, not on App2. Should I add and override onActivityResults on App2 too ? – cmh May 17 '12 at 06:03
  • Depends on which app gets the result from step 4. – MByD May 17 '12 at 06:04