I am developing an app that has private information and should not display a real screenshot in Android's recent app switcher. I've tried a variation of this solution, by setting the content view to an ImageView inside the onPause function, but it seems that the operating system takes a screenshot before the content view is changed to the custom image.
I am also aware of setting the window's layout parameter flags to secure, making the screenshot completely white, but I'd hope that there would be a way to customize the screenshot.
So, I'm wondering at what point that Android takes a screenshot of the app for the app switcher (specifically in KitKat and Lollipop).