Start an app from a second app by repeating the operation

From my app I would like to start another app and close mine automatically, doing the same operation with the one started. It would be possible.
Let me explain better I have two apps:
App n ° 1 and App n ° 2

  1. start app N ° 1
  2. With a button, I would like to start App. N ° 2 closing the app n ° 1
  3. and from App N ° 2, start App n ° 1, repeating the operation as often as necessary.
    it's possible?

You could use activity starter. When button click start activity and close app

Could you give me an example please how I connect to the apk

Using example from activity's starter documentation. Read Starting Other App Inventor Applications to figure out how to use package name

1 Like

Thank you very much indeed

1 Like

Where am I wrong? It doesn't work, you close the app but the other one doesn't open.
con action view
No action view

Try this way

1 Like

Nothing to do, maybe I keep making a mistake about the path of the connection to the app.
I tried to search for apps in the root, but I can't find them anymore.
I know I ask you a lot, but could you post me an example with a complete path for two apps you created and installed on your mobile that open and close each other?
I have created two calculators, one different from the other, I have installed them but I can no longer find the path, even if I search the Root, it seems that they do not exist, while instead they are installed and both working.
Perhaps, having slept little, something escapes me?

Did you created both apps with MIT App Inventor ?

Starting Other App Inventor Applications
You can use the Activity Starter to start another app that was created with App Inventor.   This is similar to using OpenAnotherScreen in multiple screen applications, except that now we’re dealing with two separate applications rather than two screens within a single application.  To open the other application, you need to know its package name and class name. If you have the source code of the App Inventor app (aia file), you can find these names as follows:

Download the source code to your computer.
Using a file explorer or unzip utility, find the file called youngandroidproject/project.properties .
The first line will start with " main= ". Everything after that is the package and class name.

For example, here is a first line you might see for an App named HelloPurr.


main=appinventor.ai_ElsaArendelle.HelloPurr


The ElsaArendelle part of the name comes from the App Inventor user account.


To start this app, you would use an activity starter component and set these properties:


ActivityPackage: appinventor.ai_ElsaArendelle.HelloPurr

ActivityClass: appinventor.ai_ElsaArendelle.HelloPurr.Screen

Invoking the activity starter's StartActivity method will start HelloPurr. When HelloPurr finishes (if it does), the original app's AfterActivity method will be invoked.


If you are going to start another App Inventor app, make sure you use the correct package name. For example, if someone posts the source code (aia file) for an app, and you repackage that app, you'll end up with a different package name than the original.
1 Like

Otherwise you could install Activity Launcher that will help you to find the packages and classes of all installed apps in your phone.

I used a very powerful program to search the root, it finds all android apps but not mine. Bo!
So now I don't know which path to take.

I downloaded the app you recommended, it tells me that it has created the shortcut but it does not tell me where, so where does it insert it, how can I copy it, where do I find it?

I found it thanks now I will try to enter the path.

Excellent.
It works perfectly.
Thank you for your patience and your accuracy, really thank you very much, you solved the problem that was huge for me.

1 Like