cmh
cmh

Reputation: 271

Go back to Previous Application (not Activity) in Android

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 !

Upvotes: 5

Views: 3193

Answers (1)

MByD
MByD

Reputation: 137312

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

Upvotes: 4

Related Questions