Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Go back to Previous Application (not Activity) in Android

Tags:

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 !

like image 254
cmh Avatar asked Oct 07 '22 19:10

cmh


1 Answers

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

like image 88
MByD Avatar answered Oct 12 '22 11:10

MByD