7

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!

Alex
  • 165
  • 2
  • 10
  • 1
    https://stackoverflow.com/questions/9822076/how-do-i-prevent-android-taking-a-screenshot-when-my-app-goes-to-the-background/9822607?s=3|0.4276#9822607 https://stackoverflow.com/questions/10533186/replace-image-from-recent-app-menu/10533297?s=6|0.2426#10533297 https://stackoverflow.com/questions/9984083/show-black-preview-screen-in-task-manager-on-ics/12640403?s=7|0.2117#12640403 https://stackoverflow.com/questions/27284778/need-to-hide-content-of-program-from-android-overview-screen/27306602?s=9|0.1814#27306602 – CommonsWare Nov 15 '16 at 22:10
  • Thanks @CommonsWare it worked with the secure flag! – Alex Nov 16 '16 at 21:54

2 Answers2

6

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

Steel Brain
  • 4,321
  • 28
  • 38
Alex
  • 165
  • 2
  • 10
-1

In android manifest file, in activity tag, use this

 android:excludeFromRecents="true"