Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android : Hide app content in multitasking view

Anyone knows how to hide the content of your app when the user goes in the Current Apps Manager? Like this is link is explaining for ios : http://pinkstone.co.uk/how-to-control-the-preview-screenshot-in-the-ios-multitasking-switcher/

Thanks!

like image 551
Alex Avatar asked Nov 15 '16 22:11

Alex


1 Answers

Somehow this did not work for me.. even though I read it was supposed to.

android:excludeFromRecents="true"

However, using this in your activity will do the trick:

getWindow().setFlags(LayoutParams.FLAG_SECURE, LayoutParams.FLAG_SECURE);

Thanks for your answers CommonWare & NavjotSingh

like image 195
Alex Avatar answered Nov 16 '22 10:11

Alex