Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide screen informations off Android app when it goes to the background

Tags:

android

Using FLAG_SECURE, when app goes to background screen info are invisible, however, with this option users cannot take a screenshot anymore.

it's there any way to remove FLAG_SECURE when app back to FOREGROUND ?

Or any other solution for this problem ?!

like image 475
Leandro Andrade Avatar asked Sep 26 '18 20:09

Leandro Andrade


1 Answers

You can put a black or white background in onPause and hide it in onResume if you dont need the FLAG_SECURE always active. This could prevent the window manager to exposes the screenshot in the window manager screen.

like image 133
Gibran Lyra Avatar answered Sep 30 '22 08:09

Gibran Lyra