Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WindowManager.LayoutParams.FLAG_SECURE can't change?

Tags:

android

I'm using WindowManager.LayoutParams.FLAG_SECURE to disable screenshot. Now is it possible to change the WindowManager.LayoutParams.FLAG_SECURE instantly without reloading the activity?

for example: I have a photo viewer using View Pager and I only want to disable screenshot to selected image . So can I change the flag secure by onPageChanged of view pager?

any thoughts will be highly appreciated. thanks.

like image 523
Gangnaminmo Ako Avatar asked Nov 01 '22 06:11

Gangnaminmo Ako


1 Answers

Use this code to clear the flag:

getWindow().clearFlags(WindowManager.LayoutParams.FLAG_SECURE);
like image 111
tianming shi Avatar answered Nov 12 '22 19:11

tianming shi