There are two ways to launch an application using voice command:
1. simply add one or more "Trigger sentences" in your Project properties (click on the behavior.xar). When Nao understands the trigger, it will simply launch the application, therefore, it will not be in the dialog anymore, it will have switched focus to the application;
2. write a collaborative dialog by clicking on the adding button in your Project content and selecting "Create dialog topic...". A window will pop-up, select what language you want to write your dialog with, give it a name and DON'T FORGET to tick the "Add to the package content as collaborative dialog" box.
Next is an example of a very simple collaborative dialog about a calculator:
u:(["launch the calculator" "let's do some maths"])
u:(["can you" "do you know how to"] make sums)
Of course! ^switchFocus(dialog_calculator/app)
The ^switchFocus(path_to_behavior.xar) tells the dialog engine it now has to switch focus from the dialog to the application.
To exit your application, it's up to you! You can add some dialog inside of your app like a trigger:
u:([stop quit] the application) $onStopped=1
Once you quit the application, the robot will go back to its Life state.
Sorry for the super late reply and thanks to Sarit for pointing out the fact this wasn't very clear.
You need to give the path to the behavior.xar that will start your application. If the behavior is not at the root of the project, it has to be ^switchFocus(app-UUID/path_to_folder_containing_behavior.xar). Otherwise, use ^switchFocus(app-UUID/.) and you're good to go