Hide/change the application screen picture from Recent Apps Android 4.x
G

1

6

I need to hide my application screen from the list of running applications when you click the Recent Apps button in Android 4.x. The data that my application contains could leak sensitive information if someone were to have my application running in the background. I would still like my application to be shown in recent apps, just not the screenshot.

How do you do this?

Gris answered 13/8, 2013 at 21:41 Comment(1)
#9131099 In essence, its not possible to change the thumbnail, but it is possible to hide it.Hoff
J
10

To exclude the application from recent apps you should do the following:

on Activity on Manifest android:excludeFromRecents="true" 

and you can disable thumbnail on the activity containing sensitive data by adding FLAG_SECURE to your window:

getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
Jit answered 17/2, 2014 at 21:6 Comment(1)
WindowManager.LayoutParams.FLAG_SECURE is works fine. But it is disables Screenshot option and also unable to do Automation testing(Because it needs to capture screen).Shut

© 2022 - 2024 — McMap. All rights reserved.