I want the app to start the main activity if and only if the app is not currently running. So, if the app is running, it just resumes; if not (closed/killed in order to get memory/etc), the main activity starts
The clearTaskOnLaunch
flag is not the solution because it forcefully launches the main activity on click at the app icon, regardless of the current state, and because it does not affect launching the app from the Recent Apps menu - the last known state is always restored