Run an application from another

Hello,
I have a problem and I can't find the solution to see if someone can help me.

I have an application that we will call main which opens another one called secondary but without closing the main one.
When the secondary is opened and it performs its work, it closes automatically, but when the main one is closed it does not open to continue working.

Does anyone know how I can make closing the secondary application show me the main application on the screen where it was?
The way to open the secondary application is:

ActivityStarter1.Action = android.intent.action.VIEW
ActivityStarter1.Package=appinventor.ai_app.NomApp
ActivityStarter1.Class=appinventor.ai_app.NomApp.Screen1
ActivityStarter1.Start

I hope I have explained myself correctly.
Thank you

If I got you right, you want the first one to resume work where it stopped when started again?

To do so you would need to store the current status somewhere. For example tinydb
And then implement to load these saves when started again.
Otherwise, when stopped everything gets erased and starts from scratch after opening again.

Don't close the second app. Click the back button when you are finished. Then it will go back to the home app.

Thanks for the answers I have tried them.

Patryk_F I have tried what you tell me but when I go back I get the android screen and the application is hidden and I would need it to be activated to continue working.

vinnikirsche I have also tried your answer, the problem is that the same thing happens to me when I close the second application, the first one hides and I get the android screen with the icons of my applications, and I have to search for it and activate it.

What I need is to activate the first application that is hidden.
Thank you.

I see, I think I'm getting closer to understanding your problem.

Those are two completlely different applications. And you want to press the close button in the second one, and then the first one schould open again?

You could implement that in the close action of the second application.

Maybe upload a image of your blocks? To do so just right click in the blocks windows and donwload as picture and upload it here.

Hello vinnikirsche,

Correct what happens that the first application is already open would only be to activate it and bring it to the front.
I show you the blocks that I use to call the second application.

In the second application, I only activate a position and close it with the close application block.

Thank you

Is there any particular reason to do it in another application instead of just another screen?

As I already said, you could try to implement blocks for opening application one in the close function of application two.
What function are you using to close the second application?

It is strange what you write that the application is hidden. I am also using the app call function from my one app. The way it works is that I click back and the first app appears automatically.
I don't know why it doesn't work for you.

Hello,
I have already solved it, in the second application when closing I have put the close screen block and it works, before when closing the second application I put the close application block and with this block it does not work well.

Thank you very much for your help and interest.

That's great.

For next time please be mindful of which words you use to describe your problem.
Because you used application instead of screen, which made this so complicated.
I remember even asking if why you wouldn't just use another screen.

Hello,

Ok, thank you very much for everything and sorry for my explanation.