I have a situation in an Android app where I want to start a network activity (sending out some data) which should run every second. I achieve this as follows:
Why don't you create service and put logic in onCreate(). In this case even if you press back button service will keep on executing. and once you enter into application it will not call
onCreate() again. Rather it will call onStart()