I am trying to prevent users from closing my app when it is "recording" an activity (activity here is a hike, bike ride, run etc).
If I start recording and then go to another application then hit my "recent apps" button on the phone and hit "close all" or swipe my app off the screen, it destroys it and the recording is lost.
I obviously don't want to prevent users from closing it all the time, only when they start recording and then allow them to close it again when they've stopped.
I know this behavior can be done exactly like I want because the RD Client I use for my android device does exactly this...it won't allow me to close it while I'm connected to a remote machine but then does allow me to close it once I've disconnected.
I've searched high and low and can only find information of how to programatically remove an app from the recent apps list when it's closed.
any suggestions would be greatly appreciated.