StartActivity (intention) and resume the main activity?

I have an application that creates the intent for the last.fm Android application in which it will launch the “recommended” station for my account when I press the button. The trick I'm trying to understand is how to get the phone back to my application if the user does not have to go back manually? Once it launches the last.fm intent, it will move you to the playlist, and I need it to automatically return to my application.

+1
source share
2 answers

If you use startActivity (intent), you cannot. Alternatively, you can use startActivityForResult (Intent, int) and then stop the child activity with finishActivity (int requestCode).

+1
source

Call Activity.finish () when you want to close the current activity and return to the previous one.

+1
source

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


All Articles