Return to previous application (no activity) in Android

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

:

  • launch App1 from your desktop PC. โ†’

  • run startActivity (intent) or startActivityForResult (intent, 0) in App2 from App1. โ†’

  • run startActivity (intent) or startActivityForResult (target, 0) again in App1 from App2. โ†’

  • run (?) to return to app1 (activity) or to App2.

I would like to make a dialog to allow the user to select back in App1 or App2 in step 4. Can I complete it?

I tried the article here and it just returned to activity only in App1.

Thanks for any suggestion!

+4
source share
1 answer

You must override the onActivityResults activity in App1, and if the user selects App2, just call finish on that activity.

+3
source

Source: https://habr.com/ru/post/1412904/


All Articles