
Originariamente inviato da
seblog
No, non puoi killare un applicazione,
il fatto è (sempre da quel che ho capito io) che con activitystarter to lanci un applicazione secondaria e la tua app primaria (in questo caso quella app inventor) viene bloccata (non gira più insomma)
quindi mettere un timer come avevo pensato non va bene (infatti appena lanci activitystarter ti bloccherebbe anche il timer)
Non so se sia possibile risolvere questo problema, intanto prova a leggere qui in inglese un approfondimento su activity starter:
codice:
Returning results from App Inventor Activities
You can create App Inventor activities that return a (text) result to their callers, so they can be used as subroutines. To To return a result, invoke the command close screen with result (located in the Control drawer). Your subroutine will will terminate, and the argument of close screen with result will become available to the activity starter that started it, passed as an argument to the AfterActivity event.
More specifically, suppose there is a SubroutineApp designed to be started with an activity starter and return a value, and a CallerApp that uses an ActivityStarter to call SubroutineApp. To return the result, SubroutineApp executes close screen with result, giving it as argument the result that should be returned to the caller.
On the caller side, CallerApp sets up its Activity Starter with the correct package name and class name for starting SubroutineApp. It must also set the ActivityStarter.ResultName property to the special text string APP_INVENTOR_RESULT. Then CallerApp starts the SubroutineApp activity. When the subroutine finishes, the Activity Starter's AfterActivity event triggers, and the result argument to AfteActivity will be the result that was passed back from SubroutineApp. That same information is available as the ActivityStarter's Result property.
Using this method, you can combine several App Inventor apps, both apps you write, as well as apps you share with others.
anche la risposta a questo post sembra lasciare poche speranze ...
Closing Media player through activity starter? - Android Forums
chiede come può chiudere il media player (sempre un evento activitystarter) ma lo sviluppatore google dice che quando si lancia un activity si è alla mercè di questa e quindi non è che noi possiamo controllarne la chiusura (ma bisogna chiuderla col tasto back...)
mi sa che visto che app inventor non lavora in multitask c'è poco da fare...:o
prova a dirmi che ne pensi...