I wonder if I can run more than one application from a click within my application, I mean we have a few apps on our company, for one process the user needs to add information into from 2 different applications. I wonder if is possible to create a shortcut to start those 2 applications as a separate application?
I mean each one have the flag "Intent.FLAG_ACTIVITY_NEW_TASK"
lets assign some "nicknames"
opener = Application that Im using. Where I want to add the shortcut to open the 2 applications
i1 = application 1
i2 = application 2
A sample code that I use is:
Intent i1 = getAppIntent(someValueToGetTheIntent);
if (i1 != null){
i1.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
i1.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(i1);
}
Intent i2 = getAppIntent(someOtherValueToGetTheIntent);
if (i2 != null){
i2.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
i2.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(i2);
}
When I do this the i2 application (Intent) is on the top. if I try to navigate to the i1 (in the open application menu) to switch to the other application, it doesnt exist, I can see the opener and i2 but NOT i1. If I click on the back button, then the i1 is started and then I do see all of them. but I want them to be there from the beginning.
The reason why i need the 3 open and allow the user navigate between them is because the 3 contain different information that are required to interact with the applications.
eje opener have a form to be filled with the school and students information, i1 have school information, i2 have students information.
I know that the best approach would be consolidating the apps but is not possible at this moment so this would be a great help for the users.
So I want to know how to start more than one application as new task so they both apps be on the applications menu and the user can switch between them.
EDIT
I notice the method startActivities that gets an Intent array an fires all the applications, this is kind of what I need but still.
It mentions:
"will be created when the user first visits them (due to pressing back from the activity on top)." I wonder if that back button behavior can be avoided.
So I can "create" them before the user have to press the back.