When running my app on an Android device (Samsung Galaxy S5) and the device gets locked (either by pressing the lock button or waiting for the device to eventually lock it self due to inactivity) my app is still showing. I.e. my app is showing on top of the lock screen, such that to unlock the device I have to quit the app, unlock the screen then reopen my app to continue playing.

How do I ‘hide’ my app when the device gets locked and then show it again once the device has been unlocked? (And why is this not default behaviour?)

I do not have much Android experience and have been looking at something called android.intent.action’s but I have no idea how to configure the Android manifest let alone how to listen for these events inside Unity.

Thanks in advance!

As commented by liortal the ‘problem’ was that I was building for development build and the solution was just to build for non-development build.