Hide / change the application screen image from the latest Android 4.x applications

I need to hide the application screen from the list of running applications when you click the Recent Applications button in Android 4.x. The data contained in my application may leak sensitive information if someone had to run my application in the background. I would still like my app to appear in the latest apps, rather than in the screenshot.

How do you do this?

+6
source share
1 answer

To exclude an application from recent applications, you must do the following:

on Activity on Manifest android:excludeFromRecents="true" 

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

 getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE); 
+7
source

Source: https://habr.com/ru/post/951673/


All Articles