I will simplify the question:
I want to launch an external application at a time that I developed.
Intent launchIntent = getPackageManager().getLaunchIntentForPackage("com.mariana");
startActivity(launchIntent);
and with this code I open the application.
My question is how I now close that application that is external to the one I am developing