Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 743
tyler Avatar asked Aug 13 '13 21:08

tyler


1 Answers

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);
like image 76
Flaviano Gomes Avatar answered Sep 28 '22 07:09

Flaviano Gomes