Basically,
I need to for a queue collection to persist about for about 15 seconds after a user either shuts down the app or switches to another application and then, presumably, comes to the app.
I’m looking to either save the items in the queue or process in some other way the items during the 15 seconds that they persist.
Is this possible? Can anyone point me in the right direction?
This is my second android app and the first time I have to do this so any help would be appreciated.
You can use onResume() to run commands when they com back from another task.
As for running something X seconds after they quit the application, that would require to include a “service” in your application, which could be called by your task onStop()
Although it is possible for your activity to remain active in the background you should not depend on it, as different devices will be more or less agressive with resource reclamation.
Using a service is the only sure fire way to run something in the background while orhter applications run.
http://developer.android.com/reference/android/app/Activity.html
http://developer.android.com/guide/topics/fundamentals/services.html